# TensorFlow Coder (TF-Coder)
TF-Coder is a _program synthesis_ tool that helps you write TensorFlow code.
First, the tool asks for an input-output example of the desired tensor
transformation. Then, it runs a combinatorial search to find TensorFlow
expressions that perform that transformation. TF-Coder’s output is real
TensorFlow code that you can include in your projects.
## Quick Links
[**Try TF-Coder!**](https://colab.research.google.com/github/google-research/tensorflow-coder/blob/master/TF-Coder_Colab.ipynb)
The TF-Coder tool is ready-to-use at this link. Everything is already packaged
together in a Colab notebook, so no installation or download is needed.
For more information about TF-Coder, see the following documents:
* [**TF-Coder Tutorial**](Tutorial.md): walks you through using TF-Coder to
solve tensor manipulation tasks, and provides tips on getting the most out of
TF-Coder.
* [**User Journeys**](UserJourneys.md): illustrates several realistic scenarios
where TF-Coder can help accelerate your TensorFlow development in different
ways.
## Contents
* [What is TF-Coder?](#what-is-tf-coder)
* [Tutorial and Further Reading](#tutorial-and-further-reading)
* [Optional: Using TF-Coder Outside Colab](#optional-using-tf-coder-outside-colab)
* [Citation](#citation)
## What is TF-Coder?
When manipulating tensors, one must keep track of multiple dimensions, tensor
shape and DType compatibility, and of course mathematical correctness.
Additionally, there are hundreds of TensorFlow operations, and finding the right
ones to use can be a challenge.
TensorFlow Coder, or TF-Coder, can help you write tricky tensor manipulations in
TensorFlow. Instead of coding your tensor manipulation directly, you can just
demonstrate it through an illustrative input-output example, and TF-Coder can
produce the corresponding code automatically. TF-Coder performs an efficient
combinatorial search over compositions of TensorFlow operations, until it finds
a TensorFlow expression that matches the given input-output example.
TF-Coder allows you to:
* Program in TensorFlow by example
* Find the right function to use
* Automatically combine functions in clever ways
* Spend less time debugging
TF-Coder is primarily a development tool for TensorFlow users. If you just want
to use TF-Coder as a tool, you don’t need to install anything, as the tool is
ready-to-use in this
[Colab notebook](https://colab.research.google.com/github/google-research/tensorflow-coder/blob/master/TF-Coder_Colab.ipynb).
### Caveats
There are limitations to TF-Coder. It can currently find solutions involving 3-4
operations within a minute of searching, but solutions involving 6 or more
operations are too complex to find in a reasonable amount of time. Furthermore,
TF-Coder currently does not support complex or string tensors, or RaggedTensors.
The full list of supported operations can be found here(TODO: link to the list
in Colab).
In addition, TF-Coder only guarantees that its solutions work for the given
input-output example. The tool searches for a simple TensorFlow expression that
matches the provided input-output example, but sometimes this solution is too
simple and doesn’t generalize in the intended way. It can be helpful to make the
example as unambiguous as possible, which can often be achieved by adding more
numbers to the input and output tensors. Please review TF-Coder’s solutions to
ensure that they correctly implement the intended behavior.
In the Colab tool, we would like to log the problems given to TF-Coder and the
resulting solutions, so that we can improve the tool and build a dataset that
will accelerate program synthesis research in general, but this data collection
is completely optional.
## Tutorial and Further Reading
For more information about TF-Coder, see the following documents:
* [**TF-Coder Tutorial**](Tutorial.md): walks you through using TF-Coder to
solve tensor manipulation tasks, and provides tips on getting the most out of
TF-Coder.
* [**User Journeys**](UserJourneys.md): illustrates several realistic scenarios
where TF-Coder can help accelerate your TensorFlow development in different
ways.
* [**Our research paper**](https://arxiv.org/abs/2003.09040): describes the
technology behind TF-Coder.
## Optional: Using TF-Coder Outside Colab
Because TF-Coder is primarily a development tool and not a library that you use
in your code, we hope that the provided
[Colab notebook](https://colab.research.google.com/github/google-research/tensorflow-coder/blob/master/TF-Coder_Colab.ipynb)
is sufficient for your use cases.
However, if you would rather not use the Colab notebook, you can still install
TF-Coder as a Python package yourself:
```
pip install --user tf-coder
```
To run the TF-Coder search as a library, follow the code example in
[`tf_coder_main.py`](tf_coder/tf_coder_main.py).
To run TF-Coder on our benchmarks, run:
```
python3 tf_coder/value_search/value_search_main.py
```
To run tests, clone the repository and run `pytest`.
## Citation
If you find TF-Coder helpful for a research project, you may cite our [research
paper](https://arxiv.org/abs/2003.09040) as follows:
```
@article{TFCoder,
title={{TF-Coder}: Program Synthesis for Tensor Manipulations},
author={Kensen Shi and David Bieber and Rishabh Singh},
year={2020},
url={https://arxiv.org/abs/2003.09040},
archivePrefix={arXiv},
eprint={2003.09040}
}
```
## Disclaimer
This is a research project, not an official Google product.
To report a bug or make a feature request, please raise a
[GitHub issue](https://github.com/google-research/tensorflow-coder/issues).
程序员Chino的日记
- 粉丝: 3756
- 资源: 5万+
最新资源
- 2024年度中国金融级分布式数据库市场趋势和发展现状分析报告
- 基于PyTorch+OpenCV+Flask+Vue深度学习的肿瘤辅助诊断系统源码+文档说明
- 空调系统amesim联合simulink仿真教程
- 用Matlab仿真外弹道,在已有的外弹道模型下运用龙格库塔算法进行解算,最后做了相应的GUI界面
- 2024年SAP赋能生成式AI:加速企业转型与竞争力提升
- 基于Python+Flask+Vue+PyTorch深度学习的肿瘤辅助诊断系统源码+文档说明
- MATLAB免疫遗传算法,在物流中心选址中的应用:MATLAB程序,成功开发了优化的免疫遗传算法,并应用于物流中心的选址应用中,同时给出了详细的注解 可直接应用
- 高精度自动贴片机视觉系统定位算法研究_解杨敏.pdf
- 思科2024 AI就绪数据中心白皮书解析:企业部署与挑战及解决方案
- matlab simulink仿真设计 锂电池主动均衡仿真(基于电压) 变压器系列(两节电池为例) 1.基于多绕组变压器的均衡电路(可用于模块间均衡) 本人还有buck-boost电路均衡 双向反激
- matlab程序:储能电池参与调峰调频优化 摘要:基于多能量集成的优点,本文建立了一个基于交互控制的双级两阶段框架,以实现互联多能量系统(MESs)之间的最佳能量供应 在较低的水平上,每个MES通过
- 大模型在金融领域的应用场景及其对未来金融行业的影响
- 锂电池二阶模型仿真 原创二阶RC模型, 内部参数自己拟合获得, 具有与真实数据高阶拟合,已经攻克拟合难题 2RC等效电路模型特点: 1.可自己调节RC数量; 2.可输入实验数据模拟特定电池充放电特性
- 2024腾讯云大数据年度干货合集
- 基于S7-200 PLC和MCGS组态智能机控制系统设计与实现 带解释的梯形图程序,接线图原理图图纸,io分配,组态画面
- 面向AI大模型的网络使能技术创新与发展-基于6G网络的AI服务生态及应用展望
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈