# 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).
没有合适的资源?快使用搜索试试~ 我知道了~
tensorflow-coder-0.0.1.tar.gz
0 下载量 171 浏览量
2024-03-21
12:50:18
上传
评论
收藏 108KB GZ 举报
温馨提示
共74个文件
py:66个
txt:4个
pkg-info:2个
Python库是一组预先编写的代码模块,旨在帮助开发者实现特定的编程任务,无需从零开始编写代码。这些库可以包括各种功能,如数学运算、文件操作、数据分析和网络编程等。Python社区提供了大量的第三方库,如NumPy、Pandas和Requests,极大地丰富了Python的应用领域,从数据科学到Web开发。Python库的丰富性是Python成为最受欢迎的编程语言之一的关键原因之一。这些库不仅为初学者提供了快速入门的途径,而且为经验丰富的开发者提供了强大的工具,以高效率、高质量地完成复杂任务。例如,Matplotlib和Seaborn库在数据可视化领域内非常受欢迎,它们提供了广泛的工具和技术,可以创建高度定制化的图表和图形,帮助数据科学家和分析师在数据探索和结果展示中更有效地传达信息。
资源推荐
资源详情
资源评论
收起资源包目录
tensorflow-coder-0.0.1.tar.gz (74个子文件)
tensorflow-coder-0.0.1
tf_coder
__init__.py 625B
tf_coder_utils_test.py 7KB
tf_functions.py 24KB
tensor_limits.py 972B
filter_group.py 10KB
tf_functions_test.py 6KB
datasets
__init__.py 586B
github
__init__.py 586B
tokenizer.py 2KB
data_loader.py 3KB
random_inputs_test.py 2KB
collect_tensor_data_test.py 15KB
random_inputs.py 8KB
collect_tensor_data.py 26KB
benchmarks
__init__.py 586B
stackoverflow_benchmarks.py 47KB
benchmark.py 4KB
benchmark_test.py 3KB
all_benchmarks_test.py 7KB
google_benchmarks.py 19KB
simple_benchmarks.py 11KB
test_benchmarks.py 3KB
all_benchmarks.py 3KB
tf_coder_main.py 3KB
filter_group_test.py 947B
tf_coder_utils.py 7KB
value_search
colab_interface.py 5KB
all_operations_test.py 5KB
function_operation_test.py 4KB
__init__.py 586B
operation_filtering.py 40KB
value_search_utils_test.py 3KB
filtered_values_cache_test.py 2KB
function_operation.py 6KB
operation_statistics_test.py 4KB
value_search_test.py 19KB
value_search.py 26KB
all_operations.py 3KB
operation_base.py 13KB
operation_base_test.py 6KB
python_operations_test.py 10KB
search_space_from_weight.py 6KB
filtered_values_cache.py 2KB
value_search_main_test.py 1KB
operation_statistics.py 6KB
value_search_main.py 7KB
value_search_utils.py 2KB
search_space_from_size.py 5KB
value_test.py 17KB
value.py 18KB
value_search_settings.py 7KB
operation_filtering_test.py 4KB
value_search_settings_test.py 3KB
python_operations.py 17KB
models
__init__.py 586B
tensor_features_config.py 5KB
tensor_features_model.py 19KB
natural_language
__init__.py 586B
description_handler.py 5KB
bag_of_words_handlers.py 9KB
tfidf_handler_test.py 6KB
description_handler_factory_test.py 1KB
description_handler_test.py 3KB
tfidf_handler.py 4KB
description_handler_factory.py 4KB
setup.py 3KB
PKG-INFO 8KB
setup.cfg 38B
tensorflow_coder.egg-info
SOURCES.txt 3KB
top_level.txt 9B
PKG-INFO 8KB
requires.txt 96B
dependency_links.txt 1B
README.md 6KB
共 74 条
- 1
资源评论
程序员Chino的日记
- 粉丝: 2936
- 资源: 4万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功