Skip to content

#2066 doctest update layers #2109

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
aec8f47
Update multihead_attention.py
nataliyah123 Aug 22, 2020
1085a95
Update multihead_attention.py
nataliyah123 Aug 22, 2020
f6c9af8
Update polynomial.py
nataliyah123 Aug 22, 2020
8d55d32
Update spectral_normalization.py
nataliyah123 Aug 22, 2020
c9380f9
Update wrappers.py
nataliyah123 Aug 22, 2020
aaadabd
Update multihead_attention.py
nataliyah123 Aug 22, 2020
75ce434
Convert inputs to tensor (#2108)
WindQAQ Aug 22, 2020
dda46af
removed-blank-spaces-multihead_attension
nataliyah123 Aug 23, 2020
890c691
Update multihead_attention.py
nataliyah123 Aug 23, 2020
c39916e
Update multihead_attention.py
nataliyah123 Aug 23, 2020
bdcec98
removed_white_space_wrapper
nataliyah123 Aug 23, 2020
ead0550
spaces_deleted_multihead
nataliyah123 Aug 23, 2020
bd20f6c
spaces-removed
nataliyah123 Aug 23, 2020
1aca0a6
white_space_removed_wrapper
nataliyah123 Aug 23, 2020
e4a3bbe
white_space_removed_spectralnorm
nataliyah123 Aug 23, 2020
024b960
white_space_removed_polynomial
nataliyah123 Aug 23, 2020
8a343fa
Update polynomial.py
nataliyah123 Aug 23, 2020
195ca60
Update multihead_attention.py
nataliyah123 Aug 23, 2020
d001d70
Update spectral_normalization.py
nataliyah123 Aug 23, 2020
62bf924
Update spectral_normalization.py
nataliyah123 Aug 23, 2020
f3a50e7
Deprecate MultiHeadAttention (#2112)
WindQAQ Aug 23, 2020
37a046d
removed extra closing bracket from docstring
nataliyah123 Aug 24, 2020
2d8b06b
number of elements in key value must be same
nataliyah123 Aug 24, 2020
3aead8f
multiline_1
nataliyah123 Aug 24, 2020
c2217e0
multline_spectralnormalization
nataliyah123 Aug 24, 2020
bbbdf2a
provided a value for x
nataliyah123 Aug 24, 2020
5c455e5
Update spectral_normalization.py
nataliyah123 Aug 24, 2020
170fd89
inconsistent spaces removed
nataliyah123 Aug 24, 2020
e40a266
beautifier image doc (#2101)
WindQAQ Aug 25, 2020
6329e1a
Use bazelisk (#2097)
WindQAQ Aug 25, 2020
d922875
Update spectral_normalization.py
nataliyah123 Aug 25, 2020
6a33ea5
Update spectral_normalization.py
nataliyah123 Aug 25, 2020
efa907d
Update spectral_normalization.py
nataliyah123 Aug 25, 2020
3379673
Update spectral_normalization.py
nataliyah123 Aug 25, 2020
3458b2e
Update spectral_normalization.py
nataliyah123 Aug 25, 2020
8d98ed7
Update spectral_normalization.py
nataliyah123 Aug 25, 2020
630ed29
Update spectral_normalization.py
nataliyah123 Aug 25, 2020
b1fd61a
suggested change
nataliyah123 Aug 26, 2020
81a0fd0
Update multihead_attention.py
nataliyah123 Aug 26, 2020
3291e57
Update polynomial.py
nataliyah123 Aug 26, 2020
96dd9a0
Update polynomial.py
nataliyah123 Aug 26, 2020
1fa4d2b
Install tensorflow-addons in tutorials. (#2128)
MarkDaoust Aug 27, 2020
eab8dea
fix imports and layer naming (#2129)
MarkDaoust Aug 27, 2020
ef8b0c9
Fix namedtuple generated documentation (#2130)
guillaumekln Aug 28, 2020
9acab6a
Bump black (#2135)
gabrieldemarmiesse Aug 29, 2020
dc3aa06
fix typing of num_updates in moving_average (#2136)
rushabh-v Aug 30, 2020
7c084ab
Update polynomial.py
nataliyah123 Aug 30, 2020
130bd7a
Update polynomial.py
nataliyah123 Aug 30, 2020
aa43829
Update polynomial.py
nataliyah123 Aug 30, 2020
08741c9
Add experimental_aggregate_gradients support (#2137)
fsx950223 Aug 31, 2020
5ad3476
Added eager execution for doctest
nataliyah123 Aug 31, 2020
03d02c1
Fix unwrap dtype (#2121)
WindQAQ Sep 1, 2020
b2cf8ad
added the value for n_classes
nataliyah123 Sep 1, 2020
6f4a7e0
added-value-for-x
nataliyah123 Sep 1, 2020
a14e460
Update wrappers.py
nataliyah123 Sep 1, 2020
f3243cf
Update wrappers.py
nataliyah123 Sep 1, 2020
4a36c66
Update wrappers.py
nataliyah123 Sep 1, 2020
81a809f
Update wrappers.py
nataliyah123 Sep 1, 2020
1183104
Update wrappers.py
nataliyah123 Sep 1, 2020
ced3e44
Update wrappers.py
nataliyah123 Sep 1, 2020
ae05276
Add env variable (#2141)
bhack Sep 1, 2020
83d687c
Update wrappers.py
nataliyah123 Sep 1, 2020
3ae32ad
Update wrappers.py
nataliyah123 Sep 1, 2020
a8fd9c9
Update wrappers.py
nataliyah123 Sep 1, 2020
2bf57f8
Base optimizer tracking (#2126)
bhack Sep 1, 2020
d887043
Update wrappers.py
nataliyah123 Sep 1, 2020
61ebf40
Added extra requirements for tensorflow, tensorflow-gpu, and tensorfl…
tgaddair Sep 2, 2020
c177794
fix LayerNormalization use on the right axis (#2142)
albertz Sep 2, 2020
8d3789f
Update README.md (#2148)
seanpmorgan Sep 3, 2020
cc9d7b4
Update multihead_attention.py
nataliyah123 Sep 4, 2020
d466cb8
#2066 doctest update losses (#2138)
Harsh188 Sep 4, 2020
d049d58
Add doctest section (#2151)
WindQAQ Sep 8, 2020
fc2c796
nbfmt tutorial notebooks (#2155)
lamberta Sep 9, 2020
fc50c34
Support fill_mode for transform (#2153)
WindQAQ Sep 10, 2020
3d37870
Speedup gaussian kernel generation (#2149)
WindQAQ Sep 10, 2020
41133a3
Correct a typo in average_optimizers_callback.ipynb (#2159)
anuragarnab Sep 10, 2020
5bdaf40
Avoid unnecessary reshapes for instance norm (#2158)
kaixih Sep 11, 2020
7f6bcf7
beam search decoding procedure added to seq2seq_nmt tutorial (#2140)
abhishek-niranjan Sep 11, 2020
e3e0853
Setup notebook testing (#2160)
WindQAQ Sep 11, 2020
f1006eb
Update multihead_attention.py
nataliyah123 Sep 14, 2020
3897e2f
Discriminative Layer Training (#969)
hyang0129 Sep 14, 2020
adc06a7
fixed typo in multioptimizer class name and added code owners (#2164)
hyang0129 Sep 14, 2020
8320f16
Rnn testable doctests (#2147)
Harsh188 Sep 15, 2020
1c3c072
Added support for noisy dense layers. (#2099)
LeonShams Sep 15, 2020
dbcd5aa
Added stochastic depth layer (#2154)
MHStadler Sep 16, 2020
e2006c3
Added filtered_input and constrained_decoding (#2166)
napsternxg Sep 17, 2020
13e40e6
Moved build_docs.py and BUILD into /tools/docs/ (#2167)
hp77-creator Sep 18, 2020
710903f
#2066-doc-update-metrics-latest (#2171)
nataliyah123 Sep 22, 2020
c6910b9
Merge branch '#2066-doc-update_layers' of https://github.com/nataliya…
nataliyah123 Sep 22, 2020
84753ff
fixed multihead
nataliyah123 Sep 22, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.0
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
/tensorflow_addons/layers/tests/esn_test.py @pedrolarben
/tensorflow_addons/layers/snake.py @failure-to-thrive
/tensorflow_addons/layers/tests/snake_test.py @failure-to-thrive
/tensorflow_addons/layers/stochastic_depth.py @mhstadler @windqaq
/tensorflow_addons/layers/tests/stochastic_depth_test.py @mhstadler @windqaq
/tensorflow_addons/layers/noisy_dense.py @leonshams
/tensorflow_addons/layers/tests/noisy_dense_test.py @leonshams

/tensorflow_addons/losses/contrastive.py @windqaq
/tensorflow_addons/losses/tests/contrastive_test.py @windqaq
Expand Down Expand Up @@ -146,6 +150,8 @@
/tensorflow_addons/optimizers/tests/conditional_gradient_test.py @pkan2 @lokhande-vishnu
/tensorflow_addons/optimizers/cyclical_learning_rate.py @raphaelmeudec
/tensorflow_addons/optimizers/tests/cyclical_learning_rate_test.py @raphaelmeudec
/tensorflow_addons/optimizers/discriminative_layer_training.py @hyang0129
/tensorflow_addons/optimizers/tests/discriminative_layer_training_test.py @hyang0129
/tensorflow_addons/optimizers/lamb.py @junjiek
/tensorflow_addons/optimizers/tests/lamb_test.py @junjiek
/tensorflow_addons/optimizers/lazy_adam.py @ssaishruthi
Expand Down
32 changes: 29 additions & 3 deletions .github/workflows/ci_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ on:
- master
- r*

env:
BAZEL_VERSION: 3.1.0

jobs:
flake8-test:
name: Flake8
Expand Down Expand Up @@ -98,3 +95,32 @@ jobs:
- run: pip install pygithub click
- name: Check that the CODEOWNERS is valid
run: python .github/workflows/notify_codeowners.py .github/CODEOWNERS
nbfmt:
name: Notebook format
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
- uses: actions/checkout@v2
- name: Install tensorflow-docs
run: python3 -m pip install -U git+https://github.com/tensorflow/docs
- name: Check notebook formatting
run: |
# Run on all notebooks to prevent upstream change.
echo "Check formatting with nbfmt:"
python3 -m tensorflow_docs.tools.nbfmt --test \
$(find docs/tutorials/ -type f -name *.ipynb)
nblint:
name: Notebook lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
- uses: actions/checkout@v2
- name: Install tensorflow-docs
run: python3 -m pip install -U git+https://github.com/tensorflow/docs
- name: Lint notebooks
run: |
# Run on all notebooks to prevent upstream change.
echo "Lint check with nblint:"
python3 -m tensorflow_docs.tools.nblint \
--arg=repo:tensorflow/addons \
$(find docs/tutorials/ -type f -name *.ipynb ! -path "docs/tutorials/_template.ipynb")
9 changes: 2 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ on:
- r*

env:
BAZEL_VERSION: '3.1.0'
MIN_PY_VERSION: '3.5'
MAX_PY_VERSION: '3.8'

Expand All @@ -31,7 +30,7 @@ jobs:
- name: Build wheels
run: |
pip install --default-timeout=1000 -r tools/install_deps/pytest.txt -r tools/install_deps/tensorflow-cpu.txt -r requirements.txt
bash tools/install_deps/bazel_linux.sh
bash tools/install_deps/install_bazelisk.sh ./
python configure.py
bazel test -c opt -k --test_timeout 300,450,1200,3600 --test_output=errors //tensorflow_addons/...
release-wheel:
Expand Down Expand Up @@ -60,11 +59,7 @@ jobs:
- name: Setup Bazel
# Ubuntu bazel is run inside of the docker image
if: matrix.os != 'ubuntu-18.04'
# MacOS VMs share IP addr on GH actions. This bazel installation authenticates token to prevent api rate limiting.
uses: jwlawson/actions-setup-bazel@784af34 # Version 1.1
with:
bazel-version: ${{ env.BAZEL_VERSION}}
github-api-token: ${{ secrets.GITHUB_TOKEN }}
run: bash tools/install_deps/install_bazelisk.sh ./
- name: Build wheels
env:
OS: ${{ runner.os }}
Expand Down
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,24 @@ bazel test -c opt -k \
//tensorflow_addons/...
```

#### Testing docstrings

We use [DocTest](https://docs.python.org/3/library/doctest.html) to test code snippets
in Python docstrings. The snippet must be executable Python code.
To enable testing, prepend the line with `>>>` (three left-angle brackets).
Available namespace include `np` for numpy, `tf` for TensorFlow, and `tfa` for TensorFlow Addons.
See [docs_ref](https://www.tensorflow.org/community/contribute/docs_ref) for more details.

To test docstrings locally, run either
```bash
bash tools/run_cpu_tests.sh
```
on all files, or
```bash
pytest -v -n auto --durations=25 --doctest-modules /path/to/pyfile
```
on specific files.

## About type hints

Ideally, we would like all the functions and classes constructors exposed in
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ run the following:
```
pip install tensorflow-addons
```

To ensure you have a version of TensorFlow that is compatible with TensorFlow Addons,
you can specify the `tensorflow` extra requirement during install:

```
pip install tensorflow-addons[tensorflow]
```

Similar extras exist for the `tensorflow-gpu` and `tensorflow-cpu` packages.


To use TensorFlow Addons:
Expand All @@ -72,7 +81,7 @@ what it was tested against.
| TensorFlow Addons | TensorFlow | Python |
|:----------------------- |:---|:---------- |
| tfa-nightly | 2.2, 2.3 | 3.5, 3.6, 3.7, 3.8 |
| tensorflow-addons-0.11.1 | 2.2, 2.3 |3.5, 3.6, 3.7, 3.8 |
| tensorflow-addons-0.11.2 | 2.2, 2.3 |3.5, 3.6, 3.7, 3.8 |
| tensorflow-addons-0.10.0 | 2.2 |3.5, 3.6, 3.7, 3.8 |
| tensorflow-addons-0.9.1 | 2.1, 2.2 |3.5, 3.6, 3.7 |
| tensorflow-addons-0.8.3 | 2.1 |3.5, 3.6, 3.7 |
Expand All @@ -98,7 +107,7 @@ is compiled differently. A typical example of this would be `conda`-installed Te
| TensorFlow Addons | TensorFlow | Compiler | cuDNN | CUDA |
|:----------------------- |:---- |:---------|:---------|:---------|
| tfa-nightly | 2.3 | GCC 7.3.1 | 7.6 | 10.1 |
| tensorflow-addons-0.11.1 | 2.3 | GCC 7.3.1 | 7.6 | 10.1 |
| tensorflow-addons-0.11.2 | 2.3 | GCC 7.3.1 | 7.6 | 10.1 |
| tensorflow-addons-0.10.0 | 2.2 | GCC 7.3.1 | 7.6 | 10.1 |
| tensorflow-addons-0.9.1 | 2.1 | GCC 7.3.1 | 7.6 | 10.1 |
| tensorflow-addons-0.8.3 | 2.1 | GCC 7.3.1 | 7.6 | 10.1 |
Expand Down
8 changes: 6 additions & 2 deletions build_deps/toolchains/gpu/find_cuda_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,16 @@ def get_nvcc_version(path):

nvcc_name = "nvcc.exe" if _is_windows() else "nvcc"
nvcc_path, nvcc_version = _find_versioned_file(
base_paths, ["", "bin",], nvcc_name, cuda_version, get_nvcc_version
base_paths,
["", "bin"],
nvcc_name,
cuda_version,
get_nvcc_version,
)

nvvm_path = _find_file(
base_paths,
["nvvm/libdevice", "share/cuda", "lib/nvidia-cuda-toolkit/libdevice",],
["nvvm/libdevice", "share/cuda", "lib/nvidia-cuda-toolkit/libdevice"],
"libdevice*.10.bc",
)

Expand Down
26 changes: 12 additions & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,21 @@ Any markdown or notebook files in this directory will be published to tensorflow
`tutorials/_toc.yaml` controls the left-nav on the tutorials tab. Make sure to keep that file up to date.
Notify the tensorflow/docs team if you need to major changes.

The preferred formatting for TensorFlow notebooks is to use the [tensorflow/docs](https://github.com/tensorflow/docs) [`nbfmt` tool](https://github.com/tensorflow/docs/tree/master/tools/tensorflow_docs/tools). If modifying a tutorial gives you
an unreadable diff use the following commands to re-apply the standard formatting:

```
pip install git+https://github.com/tensorflow/docs
python -m tensorflow_docs.tools.nbfmt {path to notebook file or directory}
```






## 2. Generated API docs

[tensorflow.org/addons/api_docs/python/tfa](https://tensorflow.org/addons/api_docs/python/tfa)

`build_docs.py` controls executed this docs generation. To test-run it:

```bash
# Install dependencies:
pip install -r tools/install_deps/doc_requirements.txt

# Build tool:
bazel build docs:build_docs

# Generate API doc:
# Use current branch
bazel-bin/docs/build_docs --git_branch=$(git rev-parse --abbrev-ref HEAD)
# or specified explicitly
bazel-bin/docs/build_docs --git_branch=master --output_dir=/tmp/tfa_api
```
Loading