Skip to content

Commit 4f7c24c

Browse files
committed
Merge branch 'master' into pr/PyExtreme/514
# Conflicts: # tensorflow_addons/layers/optical_flow_test.py
2 parents 639178a + 8064035 commit 4f7c24c

File tree

75 files changed

+1459
-242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1459
-242
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,3 @@ wheels/
4242
/.bazelrc
4343
/bazel-*
4444
/artifacts
45-
46-
# Addons
47-
/docs/

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ let us give you advice on the proposed changes. If the changes are
1717
minor, then feel free to make them without discussion.
1818

1919
Want to contribute but not sure of what? Here are a few suggestions:
20-
1. Add a new example or tutorial. Located in [`examples/`](examples),
20+
1. Add a new tutorial. Located in [`docs/tutorials/`](docs/tutorials),
2121
these are a great way to familiarize yourself and others with TF-Addons. See
22-
[the guidelines](examples/README.md) for more information on how to add
22+
[the guidelines](docs/tutorials/README.md) for more information on how to add
2323
examples.
2424
2. Solve an [existing issue](https://github.com/tensorflow/addons/issues).
2525
These range from low-level software bugs to higher-level design problems.

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
recursive-include tensorflow_addons/ *.so
2+
include docs/*

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ bazel-bin/build_pip_pkg artifacts
8484
pip install artifacts/tensorflow_addons-*.whl
8585
```
8686

87-
## Examples
88-
See [`examples/`](examples/)
87+
## Tutorials
88+
See [`docs/tutorials/`](docs/tutorials/)
8989
for end-to-end examples of various addons.
9090

9191
## Core Concepts

docs/_book.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# ==============================================================================
16+
upper_tabs:
17+
# Tabs left of dropdown menu
18+
- include: /_upper_tabs_left.yaml
19+
- include: /api_docs/_upper_tabs_api.yaml
20+
# Dropdown menu
21+
- name: Resources
22+
path: /resources
23+
is_default: true
24+
menu:
25+
- include: /resources/_menu_toc.yaml
26+
lower_tabs:
27+
# Subsite tabs
28+
other:
29+
- name: tutorials
30+
contents:
31+
- title: Triplet loss
32+
path: /addons/tutorials/losses_triplet
33+
- title: Image Ops
34+
path: /addons/tutorials/image_ops
35+
- title: Normalization layers
36+
path: /addons/tutorials/layers_normalizations
37+
- title: Weight normalization layer
38+
path: /addons/tutorials/layers_weightnormalization
39+
- title: Lazyadam optimizer
40+
path: /addons/tutorials/optimizers_lazyadam
41+
- name: API
42+
skip_translation: true
43+
contents:
44+
- include: /addons/api_docs/python/_toc.yaml
45+
46+
- include: /_upper_tabs_right.yaml

docs/_index.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# ==============================================================================
16+
book_path: /addons/_book.yaml
17+
project_path: /addons/_project.yaml
18+
description: <!--no description-->
19+
landing_page:
20+
custom_css_path: /site-assets/css/style.css
21+
rows:
22+
- heading: TensorFlow Addons provides useful extra functionality for TensorFlow 2.0 maintained by SIG-addons
23+
items:
24+
- classname: devsite-landing-row-50
25+
description: >
26+
TensorFlow Addons is a repository of contributions that conform to
27+
well-established API patterns, but implement new functionality
28+
not available in core TensorFlow. TensorFlow natively supports
29+
a large number of operators, layers, metrics, losses, and
30+
optimizers. However, in a fast moving field like ML, there are many
31+
interesting new developments that cannot be integrated into core
32+
TensorFlow (because their broad applicability is not yet clear, or
33+
it is mostly used by a smaller subset of the community).
34+
code_block: |
35+
<pre class = "prettyprint">
36+
import tensorflow as tf
37+
import tensorflow_addons as tfa
38+
39+
# Load MNIST dataset as NumPy arrays
40+
dataset = {}
41+
num_validation = 10000
42+
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()
43+
44+
# Preprocess the data
45+
x_train = x_train.reshape(-1, 784).astype('float32') / 255
46+
x_test = x_test.reshape(-1, 784).astype('float32') / 255
47+
48+
# Compile the model
49+
model.compile(
50+
optimizer=tfa.optimizers.LazyAdam(0.001), # Utilize TFA optimizer
51+
loss=tf.keras.losses.SparseCategoricalCrossentropy(),
52+
metrics=['accuracy'])
53+
54+
# Train the network
55+
history = model.fit(
56+
x_train,
57+
y_train,
58+
batch_size=24,
59+
epochs=10)
60+
</pre>
61+
{% dynamic if request.tld != 'cn' %}
62+
<a class="colab-button" target="_blank" href="https://colab.research.google.com/github/tensorflow/addons/blob/master/docs/tutorials/optimizers_lazyadam.ipynb">Run in a <span>Notebook</span></a>
63+
{% dynamic endif %}
64+
- classname: devsite-landing-row-cards
65+
items:
66+
- heading: "Introducing TensorFlow Addons"
67+
image_path: /resources/images/tf-logo-card-16x9.png
68+
path: https://medium.com/tensorflow/introducing-tensorflow-addons-6131a50a3dcf
69+
buttons:
70+
- label: "Read on TensorFlow blog"
71+
path: https://medium.com/tensorflow/introducing-tensorflow-addons-6131a50a3dcf
72+
- heading: "TensorFlow Addons on GitHub"
73+
image_path: /resources/images/github-card-16x9.png
74+
path: https://github.com/tensorflow/addons
75+
buttons:
76+
- label: "View on GitHub"
77+
path: https://github.com/tensorflow/addons

docs/_project.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# ==============================================================================
16+
name: TensorFlow Addons
17+
breadcrumb_name: Addons
18+
home_url: /addons/
19+
parent_project_metadata_path: /_project.yaml
20+
description: >
21+
"TensorFlow Addons is a library of useful extra functionality for
22+
TensorFlow 2.0 maintained by SIG-addons"
23+
use_site_branding: true
24+
hide_from_products_list: true
25+
content_license: cc-apache
26+
include: /_project_included.yaml

examples/README.md renamed to docs/tutorials/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# TensorFlow Addons Examples
1+
# TensorFlow Addons Tutorials
22

3-
TensorFlow Addons welcomes and highly encourages example contributions.
3+
TensorFlow Addons welcomes and highly encourages tutorial contributions.
44

55

66
## How To Contribute
77

8-
Addons examples are created using [Google Colab](https://colab.research.google.com/)
8+
Addons tutorials are created using [Google Colab](https://colab.research.google.com/)
99
and the jupyter notebooks are saved to this directory in the repository. To do
1010
this, follow the below steps:
1111

1212
1. Create a new branch on your fork of TensorFlow Addons
1313
2. Goto [Google Colab](https://colab.research.google.com/) and start a new
1414
notebook using addons example template:
15-
[examples/template.ipynb](template.ipynb)
15+
[docs/tutorials/template.ipynb](template.ipynb)
1616
3. Edit the the links for the "View source on GitHub" and "Run in Google Colab"
1717
URL boxes so that they match the name of your new example notebook
1818
4. Follow the guidelines of the template

examples/image_ops.ipynb renamed to docs/tutorials/image_ops.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@
5959
"\n",
6060
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
6161
" <td>\n",
62-
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/addons/blob/master/examples/image_ops.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
62+
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/addons/blob/master/docs/tutorials/image_ops.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
6363
" </td>\n",
6464
" <td>\n",
65-
" <a target=\"_blank\" href=\"https://github.com/tensorflow/addons/blob/master/examples/image_ops.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
65+
" <a target=\"_blank\" href=\"https://github.com/tensorflow/addons/blob/master/docs/tutorials/image_ops.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
6666
" </td>\n",
6767
"</table>"
6868
]

examples/layers_normalizations.ipynb renamed to docs/tutorials/layers_normalizations.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@
6161
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
6262
"\n",
6363
" <td>\n",
64-
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/addons/blob/master/examples/layers_normalizations.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
64+
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/addons/blob/master/docs/tutorials/layers_normalizations.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
6565
" </td>\n",
6666
" <td>\n",
67-
" <a target=\"_blank\" href=\"https://github.com/tensorflow/addons/blob/master/examples/layers_normalizations.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
67+
" <a target=\"_blank\" href=\"https://github.com/tensorflow/addons/blob/master/docs/tutorials/layers_normalizations.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
6868
" </td>\n",
6969
"</table>\n"
7070
]

0 commit comments

Comments
 (0)