New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial setup for tensorflow subsite #486
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
aa6b76c
Initial setup for tensorflow subsite
seanpmorgan 18a6327
Add examples to pip package
seanpmorgan a7d32e0
Move examples and rename as tutorials
seanpmorgan 2a3578b
Update example code
seanpmorgan 5a36b51
Spelling and style
seanpmorgan 00e91db
Update README to use the word `tutorials`
seanpmorgan File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,3 @@ wheels/ | |
/.bazelrc | ||
/bazel-* | ||
/artifacts | ||
|
||
# Addons | ||
/docs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
recursive-include tensorflow_addons/ *.so | ||
include docs/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# ============================================================================== | ||
upper_tabs: | ||
# Tabs left of dropdown menu | ||
- include: /_upper_tabs_left.yaml | ||
- include: /api_docs/_upper_tabs_api.yaml | ||
# Dropdown menu | ||
- name: Resources | ||
path: /resources | ||
is_default: true | ||
menu: | ||
- include: /resources/_menu_toc.yaml | ||
lower_tabs: | ||
# Subsite tabs | ||
other: | ||
- name: tutorials | ||
contents: | ||
- title: Triplet loss | ||
path: /addons/tutorials/losses_triplet | ||
- title: Image Ops | ||
path: /addons/tutorials/image_ops | ||
- title: Normalization layers | ||
path: /addons/tutorials/layers_normalizations | ||
- title: Weight normalization layer | ||
path: /addons/tutorials/layers_weightnormalization | ||
- title: Lazyadam optimizer | ||
path: /addons/tutorials/optimizers_lazyadam | ||
- name: API | ||
skip_translation: true | ||
contents: | ||
- include: /addons/api_docs/python/_toc.yaml | ||
seanpmorgan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- include: /_upper_tabs_right.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# ============================================================================== | ||
book_path: /addons/_book.yaml | ||
project_path: /addons/_project.yaml | ||
description: <!--no description--> | ||
landing_page: | ||
custom_css_path: /site-assets/css/style.css | ||
rows: | ||
- heading: TensorFlow Addons provides useful extra functionality for TensorFlow 2.0 maintained by SIG-addons | ||
items: | ||
- classname: devsite-landing-row-50 | ||
description: > | ||
TensorFlow Addons is a repository of contributions that conform to | ||
well-established API patterns, but implement new functionality | ||
not available in core TensorFlow. TensorFlow natively supports | ||
a large number of operators, layers, metrics, losses, and | ||
optimizers. However, in a fast moving field like ML, there are many | ||
interesting new developments that cannot be integrated into core | ||
TensorFlow (because their broad applicability is not yet clear, or | ||
it is mostly used by a smaller subset of the community). | ||
code_block: | | ||
<pre class = "prettyprint"> | ||
import tensorflow as tf | ||
import tensorflow_addons as tfa | ||
|
||
# Load MNIST dataset as NumPy arrays | ||
dataset = {} | ||
num_validation = 10000 | ||
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data() | ||
|
||
# Preprocess the data | ||
x_train = x_train.reshape(-1, 784).astype('float32') / 255 | ||
x_test = x_test.reshape(-1, 784).astype('float32') / 255 | ||
|
||
# Compile the model | ||
model.compile( | ||
optimizer=tfa.optimizers.LazyAdam(0.001), # Utilize TFA optimizer | ||
loss=tf.keras.losses.SparseCategoricalCrossentropy(), | ||
metrics=['accuracy']) | ||
|
||
# Train the network | ||
history = model.fit( | ||
x_train, | ||
y_train, | ||
batch_size=24, | ||
epochs=10) | ||
</pre> | ||
{% dynamic if request.tld != 'cn' %} | ||
<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> | ||
{% dynamic endif %} | ||
seanpmorgan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- classname: devsite-landing-row-cards | ||
items: | ||
- heading: "Introducing TensorFlow Addons" | ||
image_path: /resources/images/tf-logo-card-16x9.png | ||
path: https://medium.com/tensorflow/introducing-tensorflow-addons-6131a50a3dcf | ||
buttons: | ||
- label: "Read on TensorFlow blog" | ||
path: https://medium.com/tensorflow/introducing-tensorflow-addons-6131a50a3dcf | ||
- heading: "TensorFlow Addons on GitHub" | ||
image_path: /resources/images/github-card-16x9.png | ||
path: https://github.com/tensorflow/addons | ||
buttons: | ||
- label: "View on GitHub" | ||
path: https://github.com/tensorflow/addons |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# ============================================================================== | ||
name: TensorFlow Addons | ||
breadcrumb_name: Addons | ||
home_url: /addons/ | ||
parent_project_metadata_path: /_project.yaml | ||
description: > | ||
"TensorFlow Addons is a library of useful extra functionality for | ||
TensorFlow 2.0 maintained by SIG-addons" | ||
use_site_branding: true | ||
hide_from_products_list: true | ||
content_license: cc-apache | ||
include: /_project_included.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lamberta So this part I'm still unclear on. Where does the directory "addons" come from? Is it just the repository name?
Does it need to be
addons/docs/tutorials/*
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"/addons/tutorials/losses_triplet" is correct.
The workflow is "take a directory and put it on the site". Addons is just the name for this directory on the site.
So we'll set up the tools to take "https://github.com/tensorflow/addons/tree/master/docs" and put it on the site as "tensorflow.org/addons".
So two things to remember about links for that:
Use relative links when linking between files within the directory (so users keep their github/colab/tensorflow.org context). Use full URLs if you need to link to something outside of the directory. Never use absolute path links.
In notebooks and markdown
tfa.thing
will be auto-linked to the appropriate api-page, if it exists.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thanks. So just to be clear will the utilized directory always come from
master
branch? At the moment we only generate docs for our release branches, but that'd probably require you pulling down a new directory for each release.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarkDaoust @lamberta Friendly bump on this question and then we can look to merge this. Are we required to have the latest releases API docs on our master branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we've simplified the setup. There is now no requirement to have api_docs in you repo at all. When we generate the site, we'll run your
build_docs.py
script against your latest pip package, to generate theapi_docs
pages.Yes. While api reference material is generated from your pip package, we pull the rest of the docs from master so that doc-fixes don't need to wait for a release.
The one caution there is that notebooks demonstrating features for a future release need to be sure to
pip install
an appropriate nightly or preview package, but if you're test running things in colab, for example, that should be easy to remember.