Skip to content

Conversation

@WindQAQ
Copy link
Member

@WindQAQ WindQAQ commented Sep 13, 2020

Description

  • Fixes Generated documentation of type aliases are included in unrelated modules #2132. The exposed namespace aligns to the one of core TF: tf.types.experiemental.* vs tfa.types.*.
  • Use explicit_package_contents_filter to filter out meaningless endpoints. Like the module down below will not be generated.
  • Pin to newest tensorflow_docs version. This is discussion needed. IMO, it doesn't really matter on our end unless docs team has some breaking change on the interface the API generator.

image

Diff TOC

diff --git a/home/windqaq/addons_api/_toc.yaml b/home/windqaq/new_addons_api/_toc.yaml
index 7c9c58a..45ee1f7 100644
--- a/home/windqaq/addons_api/_toc.yaml
+++ b/home/windqaq/new_addons_api/_toc.yaml
@@ -3,6 +3,8 @@ toc:
   section:
   - title: Overview
     path: /addons/api_docs/python/tfa
+  - title: register_all
+    path: /addons/api_docs/python/tfa/register_all
 - title: tfa.activations
   section:
   - title: Overview
@@ -35,18 +37,6 @@ toc:
     path: /addons/api_docs/python/tfa/callbacks/TimeStopping
   - title: TQDMProgressBar
     path: /addons/api_docs/python/tfa/callbacks/TQDMProgressBar
-  - title: average_model_checkpoint
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/callbacks/average_model_checkpoint
-  - title: time_stopping
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/callbacks/time_stopping
-  - title: tqdm_progress_bar
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/callbacks/tqdm_progress_bar
 - title: tfa.image
   section:
   - title: Overview
@@ -97,76 +87,6 @@ toc:
     path: /addons/api_docs/python/tfa/image/translate
   - title: translate_xy
     path: /addons/api_docs/python/tfa/image/translate_xy
-  - title: color_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/color_ops
-    - title: equalize_image
-      path: /addons/api_docs/python/tfa/image/color_ops/equalize_image
-    - title: Number
-      path: /addons/api_docs/python/tfa/image/color_ops/Number
-    - title: sharpness_image
-      path: /addons/api_docs/python/tfa/image/color_ops/sharpness_image
-    - title: TensorLike
-      path: /addons/api_docs/python/tfa/image/color_ops/TensorLike
-  - title: compose_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/compose_ops
-  - title: cutout_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/cutout_ops
-  - title: distance_transform
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/distance_transform
-  - title: distort_image_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/distort_image_ops
-  - title: filters
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/filters
-    - title: FloatTensorLike
-      path: /addons/api_docs/python/tfa/image/filters/FloatTensorLike
-  - title: resampler_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/resampler_ops
-  - title: transform_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/transform_ops
-    - title: angles_to_projective_transforms
-      path: /addons/api_docs/python/tfa/image/transform_ops/angles_to_projective_transforms
-    - title: compose_transforms
-      path: /addons/api_docs/python/tfa/image/transform_ops/compose_transforms
-    - title: flat_transforms_to_matrices
-      path: /addons/api_docs/python/tfa/image/transform_ops/flat_transforms_to_matrices
-    - title: matrices_to_flat_transforms
-      path: /addons/api_docs/python/tfa/image/transform_ops/matrices_to_flat_transforms
-  - title: translate_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/translate_ops
-    - title: translations_to_projective_transforms
-      path: /addons/api_docs/python/tfa/image/translate_ops/translations_to_projective_transforms
-  - title: utils
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/utils
-    - title: from_4D_image
-      path: /addons/api_docs/python/tfa/image/utils/from_4D_image
-    - title: get_ndims
-      path: /addons/api_docs/python/tfa/image/utils/get_ndims
-    - title: to_4D_image
-      path: /addons/api_docs/python/tfa/image/utils/to_4D_image
-    - title: unwrap
-      path: /addons/api_docs/python/tfa/image/utils/unwrap
-    - title: wrap
-      path: /addons/api_docs/python/tfa/image/utils/wrap
 - title: tfa.layers
   section:
   - title: Overview
@@ -215,76 +135,6 @@ toc:
     path: /addons/api_docs/python/tfa/layers/TLU
   - title: WeightNormalization
     path: /addons/api_docs/python/tfa/layers/WeightNormalization
-  - title: adaptive_pooling
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/adaptive_pooling
-    - title: AdaptivePooling1D
-      path: /addons/api_docs/python/tfa/layers/adaptive_pooling/AdaptivePooling1D
-    - title: AdaptivePooling2D
-      path: /addons/api_docs/python/tfa/layers/adaptive_pooling/AdaptivePooling2D
-    - title: AdaptivePooling3D
-      path: /addons/api_docs/python/tfa/layers/adaptive_pooling/AdaptivePooling3D
-  - title: esn
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/esn
-    - title: Activation
-      path: /addons/api_docs/python/tfa/layers/esn/Activation
-    - title: Initializer
-      path: /addons/api_docs/python/tfa/layers/esn/Initializer
-  - title: gelu
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/gelu
-  - title: maxout
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/maxout
-  - title: multihead_attention
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/multihead_attention
-  - title: normalizations
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/normalizations
-  - title: optical_flow
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/optical_flow
-  - title: poincare
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/poincare
-  - title: polynomial
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/polynomial
-  - title: snake
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/snake
-  - title: sparsemax
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/sparsemax
-  - title: spatial_pyramid_pooling
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/spatial_pyramid_pooling
-  - title: spectral_normalization
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/spectral_normalization
-  - title: tlu
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/tlu
-  - title: wrappers
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/wrappers
 - title: tfa.losses
   section:
   - title: Overview
@@ -331,42 +181,6 @@ toc:
     path: /addons/api_docs/python/tfa/losses/triplet_semihard_loss
   - title: WeightedKappaLoss
     path: /addons/api_docs/python/tfa/losses/WeightedKappaLoss
-  - title: contrastive
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/contrastive
-  - title: focal_loss
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/focal_loss
-  - title: kappa_loss
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/kappa_loss
-  - title: lifted
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/lifted
-  - title: metric_learning
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/metric_learning
-    - title: angular_distance
-      path: /addons/api_docs/python/tfa/losses/metric_learning/angular_distance
-    - title: pairwise_distance
-      path: /addons/api_docs/python/tfa/losses/metric_learning/pairwise_distance
-  - title: npairs
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/npairs
-  - title: quantiles
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/quantiles
-  - title: triplet
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/triplet
 - title: tfa.metrics
   section:
   - title: Overview
@@ -391,44 +205,6 @@ toc:
     path: /addons/api_docs/python/tfa/metrics/MultiLabelConfusionMatrix
   - title: RSquare
     path: /addons/api_docs/python/tfa/metrics/RSquare
-  - title: cohens_kappa
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/cohens_kappa
-    - title: AcceptableDTypes
-      path: /addons/api_docs/python/tfa/metrics/cohens_kappa/AcceptableDTypes
-  - title: f_scores
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/f_scores
-  - title: geometric_mean
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/geometric_mean
-  - title: hamming
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/hamming
-    - title: hamming_loss_fn
-      path: /addons/api_docs/python/tfa/metrics/hamming/hamming_loss_fn
-  - title: matthews_correlation_coefficient
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/matthews_correlation_coefficient
-  - title: multilabel_confusion_matrix
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/multilabel_confusion_matrix
-  - title: r_square
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/r_square
-  - title: utils
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/utils
-    - title: sample_weight_shape_match
-      path: /addons/api_docs/python/tfa/metrics/utils/sample_weight_shape_match
 - title: tfa.optimizers
   section:
   - title: Overview
@@ -469,76 +245,6 @@ toc:
     path: /addons/api_docs/python/tfa/optimizers/TriangularCyclicalLearningRate
   - title: Yogi
     path: /addons/api_docs/python/tfa/optimizers/Yogi
-  - title: average_wrapper
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/average_wrapper
-  - title: conditional_gradient
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/conditional_gradient
-  - title: cyclical_learning_rate
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/cyclical_learning_rate
-  - title: lamb
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/lamb
-  - title: lazy_adam
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/lazy_adam
-  - title: lookahead
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/lookahead
-  - title: moving_average
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/moving_average
-  - title: novograd
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/novograd
-  - title: proximal_adagrad
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/proximal_adagrad
-  - title: rectified_adam
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/rectified_adam
-  - title: stochastic_weight_averaging
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/stochastic_weight_averaging
-  - title: weight_decay_optimizers
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/weight_decay_optimizers
-    - title: DecoupledWeightDecayExtension
-      path: /addons/api_docs/python/tfa/optimizers/weight_decay_optimizers/DecoupledWeightDecayExtension
-  - title: yogi
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/yogi
-- title: tfa.options
-  section:
-  - title: Overview
-    path: /addons/api_docs/python/tfa/options
-  - title: warn_fallback
-    path: /addons/api_docs/python/tfa/options/warn_fallback
-- title: tfa.register
-  section:
-  - title: Overview
-    path: /addons/api_docs/python/tfa/register
-  - title: register_all
-    path: /addons/api_docs/python/tfa/register/register_all
-  - title: register_custom_kernels
-    path: /addons/api_docs/python/tfa/register/register_custom_kernels
-  - title: register_keras_objects
-    path: /addons/api_docs/python/tfa/register/register_keras_objects
 - title: tfa.rnn
   section:
   - title: Overview
@@ -553,26 +259,6 @@ toc:
     path: /addons/api_docs/python/tfa/rnn/NASCell
   - title: PeepholeLSTMCell
     path: /addons/api_docs/python/tfa/rnn/PeepholeLSTMCell
-  - title: esn_cell
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/rnn/esn_cell
-  - title: layer_norm_lstm_cell
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/rnn/layer_norm_lstm_cell
-  - title: layer_norm_simple_rnn_cell
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/rnn/layer_norm_simple_rnn_cell
-  - title: nas_cell
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/rnn/nas_cell
-  - title: peephole_lstm_cell
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/rnn/peephole_lstm_cell
 - title: tfa.seq2seq
   section:
   - title: Overview
@@ -641,40 +327,6 @@ toc:
     path: /addons/api_docs/python/tfa/seq2seq/tile_batch
   - title: TrainingSampler
     path: /addons/api_docs/python/tfa/seq2seq/TrainingSampler
-  - title: attention_wrapper
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/seq2seq/attention_wrapper
-  - title: basic_decoder
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/seq2seq/basic_decoder
-  - title: beam_search_decoder
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/seq2seq/beam_search_decoder
-    - title: attention_probs_from_attn_state
-      path: /addons/api_docs/python/tfa/seq2seq/beam_search_decoder/attention_probs_from_attn_state
-    - title: BeamSearchDecoderMixin
-      path: /addons/api_docs/python/tfa/seq2seq/beam_search_decoder/BeamSearchDecoderMixin
-    - title: get_attention_probs
-      path: /addons/api_docs/python/tfa/seq2seq/beam_search_decoder/get_attention_probs
-  - title: decoder
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/seq2seq/decoder
-  - title: loss
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/seq2seq/loss
-  - title: sampler
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/seq2seq/sampler
-    - title: bernoulli_sample
-      path: /addons/api_docs/python/tfa/seq2seq/sampler/bernoulli_sample
-    - title: categorical_sample
-      path: /addons/api_docs/python/tfa/seq2seq/sampler/categorical_sample
 - title: tfa.text
   section:
   - title: Overview
@@ -707,17 +359,21 @@ toc:
     path: /addons/api_docs/python/tfa/text/skip_gram_sample_with_text_vocab
   - title: viterbi_decode
     path: /addons/api_docs/python/tfa/text/viterbi_decode
-  - title: crf
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/text/crf
-    - title: CrfDecodeForwardRnnCell
-      path: /addons/api_docs/python/tfa/text/crf/CrfDecodeForwardRnnCell
-  - title: parse_time_op
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/text/parse_time_op
-  - title: skip_gram_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/text/skip_gram_ops
+- title: tfa.types
+  section:
+  - title: Overview
+    path: /addons/api_docs/python/tfa/types
+  - title: AcceptableDTypes
+    path: /addons/api_docs/python/tfa/types/AcceptableDTypes
+  - title: Activation
+    path: /addons/api_docs/python/tfa/types/Activation
+  - title: Constraint
+    path: /addons/api_docs/python/tfa/types/Constraint
+  - title: FloatTensorLike
+    path: /addons/api_docs/python/tfa/types/FloatTensorLike
+  - title: Number
+    path: /addons/api_docs/python/tfa/types/Number
+  - title: Optimizer
+    path: /addons/api_docs/python/tfa/types/Optimizer
+  - title: TensorLike
+    path: /addons/api_docs/python/tfa/types/TensorLike

Diff gaussian_filter2d.md for example

diff --git a/home/windqaq/addons_api/tfa/image/gaussian_filter2d.md b/home/windqaq/new_addons_api/tfa/image/gaussian_filter2d.md
index ce6e66a..4f8678f 100644
--- a/home/windqaq/addons_api/tfa/image/gaussian_filter2d.md
+++ b/home/windqaq/new_addons_api/tfa/image/gaussian_filter2d.md
@@ -22,24 +22,16 @@ description: Perform Gaussian blur on image(s).
 
 Perform Gaussian blur on image(s).
 
-<section class="expandable">
-  <h4 class="showalways">View aliases</h4>
-  <p>
-<b>Main aliases</b>
-<p>`tfa.image.filters.gaussian_filter2d`</p>
-</p>
-</section>
-
 <pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link">
 <code>@tf.function</code>
 <code>tfa.image.gaussian_filter2d(
-    image: <a href="../../tfa/image/filters/FloatTensorLike.md"><code>tfa.image.filters.FloatTensorLike</code></a>,
+    image: <a href="../../tfa/types/FloatTensorLike.md"><code>tfa.types.FloatTensorLike</code></a>,
     filter_shape: Union[List[int], Tuple[int]] = [3, 3],
     sigma: Union[List[float], Tuple[float]] = 1.0,
     padding: str = 'REFLECT',
-    constant_values: <a href="../../tfa/image/color_ops/TensorLike.md"><code>tfa.image.color_ops.TensorLike</code></a> = 0,
+    constant_values: <a href="../../tfa/types/TensorLike.md"><code>tfa.types.TensorLike</code></a> = 0,
     name: Optional[str] = None
-) -> <a href="../../tfa/image/filters/FloatTensorLike.md"><code>tfa.image.filters.FloatTensorLike</code></a>
+) -> <a href="../../tfa/types/FloatTensorLike.md"><code>tfa.types.FloatTensorLike</code></a>
 </code></pre>

Type of change

Checklist:

  • I've properly formatted my code according to the guidelines
    • By running Black + Flake8
    • By running pre-commit hooks
  • This PR addresses an already submitted issue for TensorFlow Addons
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • This PR contains modifications to C++ custom-ops

How Has This Been Tested?

If you're adding a bugfix or new feature please describe the tests that you ran to verify your changes:
*

@WindQAQ WindQAQ requested a review from a team September 14, 2020 16:51
@WindQAQ
Copy link
Member Author

WindQAQ commented Sep 15, 2020

@MarkDaoust, Hi Mark, can you help review this when time allows? Thank you!

@MarkDaoust
Copy link
Member

MarkDaoust commented Sep 15, 2020

explicit_package_contents_filter

Good idea.

The main thing to remember with this setting is that the now the imports in your__init__.py are the definition of your public API. With this is's best not to put any code in the init files other than imports.

If that's what you want -> great. If ever something isn't showing up it's probably just missing an import.

If you've been test-running this could you post a git diff --stat of the output directory? this would make it clear what affect this has on the generated pages.

@WindQAQ
Copy link
Member Author

WindQAQ commented Sep 15, 2020

The main thing to remember with this setting is that the now the imports in your__init__.py are the definition of your public API. With this is's best not to put any code in the init files other than imports.

That's actually what I want. /cc @seanpmorgan @bhack for discussion.

Here is the diff file.

diff

 .../{addons_api => new_addons_api}/_redirects.yaml |  444 +-
 .../{addons_api => new_addons_api}/_toc.yaml       |  384 +-
 .../{addons_api => new_addons_api}/index.md        |  342 +-
 .../tfa/_api_cache.json                            | 6081 +-------------------
 .../tfa/activations/gelu.md                        |    2 +-
 .../tfa/activations/hardshrink.md                  |    6 +-
 .../tfa/activations/lisht.md                       |    2 +-
 .../tfa/activations/mish.md                        |    2 +-
 .../tfa/activations/rrelu.md                       |    6 +-
 .../tfa/activations/snake.md                       |    4 +-
 .../tfa/activations/softshrink.md                  |    6 +-
 .../tfa/activations/sparsemax.md                   |    2 +-
 .../tfa/activations/tanhshrink.md                  |    2 +-
 .../tfa/callbacks/AverageModelCheckpoint.md        |    8 -
 .../tfa/callbacks/TQDMProgressBar.md               |    8 -
 .../tfa/callbacks/TimeStopping.md                  |    8 -
 .../average_model_checkpoint.md => dev/null}       |   28 -
 .../tfa/callbacks/time_stopping.md => dev/null}    |   30 -
 .../callbacks/tqdm_progress_bar.md => dev/null}    |   30 -
 .../tfa/callbacks.md                               |    8 -
 .../tfa/image/adjust_hsv_in_yiq.md                 |   16 +-
 .../tfa/image/blend.md                             |   14 +-
 .../image/color_ops/equalize_image.md => dev/null} |   34 -
 .../color_ops/sharpness_image.md => dev/null}      |   34 -
 .../addons_api/tfa/image/color_ops.md => dev/null} |   43 -
 .../tfa/image/compose_ops.md => dev/null}          |   36 -
 .../tfa/image/connected_components.md              |    2 +-
 .../tfa/image/cutout.md                            |   16 +-
 .../tfa/image/cutout_ops.md => dev/null}           |   38 -
 .../tfa/image/dense_image_warp.md                  |    4 +-
 .../tfa/image/distance_transform.md => dev/null}   |   34 -
 .../tfa/image/distort_image_ops.md => dev/null}    |   38 -
 .../tfa/image/equalize.md                          |   10 +-
 .../tfa/image/euclidean_dist_transform.md          |   10 +-
 .../addons_api/tfa/image/filters.md => dev/null}   |   38 -
 .../tfa/image/gaussian_filter2d.md                 |   14 +-
 .../tfa/image/interpolate_bilinear.md              |    4 +-
 .../tfa/image/interpolate_spline.md                |    8 +-
 .../tfa/image/mean_filter2d.md                     |   12 +-
 .../tfa/image/median_filter2d.md                   |   12 +-
 .../tfa/image/random_cutout.md                     |   16 +-
 .../tfa/image/random_hsv_in_yiq.md                 |   20 +-
 .../tfa/image/resampler.md                         |   12 +-
 .../tfa/image/resampler_ops.md => dev/null}        |   30 -
 .../tfa/image/rotate.md                            |   12 +-
 .../tfa/image/sharpness.md                         |   12 +-
 .../tfa/image/shear_x.md                           |   14 +-
 .../tfa/image/shear_y.md                           |   14 +-
 .../tfa/image/sparse_image_warp.md                 |    8 +-
 .../tfa/image/transform.md                         |   12 +-
 .../null}                                          |   84 -
 .../compose_transforms.md => dev/null}             |   77 -
 .../flat_transforms_to_matrices.md => dev/null}    |   94 -
 .../matrices_to_flat_transforms.md => dev/null}    |   95 -
 .../tfa/image/transform_ops.md => dev/null}        |   48 -
 .../tfa/image/translate.md                         |   12 +-
 .../null}                                          |   76 -
 .../tfa/image/translate_ops.md => dev/null}        |   38 -
 .../tfa/image/translate_xy.md                      |   16 +-
 .../tfa/image/utils/from_4D_image.md => dev/null}  |   71 -
 .../tfa/image/utils/get_ndims.md => dev/null}      |   31 -
 .../tfa/image/utils/to_4D_image.md => dev/null}    |   64 -
 .../tfa/image/utils/unwrap.md => dev/null}         |   81 -
 .../tfa/image/utils/wrap.md => dev/null}           |   33 -
 .../addons_api/tfa/image/utils.md => dev/null}     |   38 -
 .../{addons_api => new_addons_api}/tfa/image.md    |   22 -
 .../tfa/layers/AdaptiveAveragePooling1D.md         |   10 -
 .../tfa/layers/AdaptiveAveragePooling2D.md         |   10 -
 .../tfa/layers/AdaptiveAveragePooling3D.md         |   10 -
 .../tfa/layers/AdaptiveMaxPooling1D.md             |   10 -
 .../tfa/layers/AdaptiveMaxPooling2D.md             |   10 -
 .../tfa/layers/AdaptiveMaxPooling3D.md             |   10 -
 .../tfa/layers/CorrelationCost.md                  |    8 -
 .../tfa/layers/ESN.md                              |   24 +-
 .../tfa/layers/FilterResponseNormalization.md      |   22 +-
 .../tfa/layers/GELU.md                             |    8 -
 .../tfa/layers/GroupNormalization.md               |   20 +-
 .../tfa/layers/InstanceNormalization.md            |    8 -
 .../tfa/layers/Maxout.md                           |    8 -
 .../tfa/layers/MultiHeadAttention.md               |    8 -
 .../tfa/layers/PoincareNormalize.md                |    8 -
 .../tfa/layers/PolynomialCrossing.md               |   16 +-
 .../tfa/layers/Snake.md                            |   10 +-
 .../tfa/layers/Sparsemax.md                        |    8 -
 .../tfa/layers/SpatialPyramidPooling2D.md          |    8 -
 .../tfa/layers/SpectralNormalization.md            |    8 -
 .../tfa/layers/TLU.md                              |   20 +-
 .../tfa/layers/WeightNormalization.md              |    8 -
 .../AdaptivePooling1D.md => dev/null}              | 1043 ----
 .../AdaptivePooling2D.md => dev/null}              | 1043 ----
 .../AdaptivePooling3D.md => dev/null}              | 1043 ----
 .../tfa/layers/adaptive_pooling.md => dev/null}    |   46 -
 .../addons_api/tfa/layers/esn.md => dev/null}      |   40 -
 .../addons_api/tfa/layers/gelu.md => dev/null}     |   30 -
 .../addons_api/tfa/layers/maxout.md => dev/null}   |   30 -
 .../tfa/layers/multihead_attention.md => dev/null} |   28 -
 .../tfa/layers/normalizations.md => dev/null}      |   32 -
 .../tfa/layers/optical_flow.md => dev/null}        |   30 -
 .../addons_api/tfa/layers/poincare.md => dev/null} |   30 -
 .../tfa/layers/polynomial.md => dev/null}          |   30 -
 .../addons_api/tfa/layers/snake.md => dev/null}    |   30 -
 .../tfa/layers/sparsemax.md => dev/null}           |   28 -
 .../layers/spatial_pyramid_pooling.md => dev/null} |   30 -
 .../layers/spectral_normalization.md => dev/null}  |   28 -
 .../addons_api/tfa/layers/tlu.md => dev/null}      |   30 -
 .../addons_api/tfa/layers/wrappers.md => dev/null} |   28 -
 .../{addons_api => new_addons_api}/tfa/layers.md   |   32 -
 .../tfa/losses/ContrastiveLoss.md                  |   10 +-
 .../tfa/losses/LiftedStructLoss.md                 |   10 +-
 .../tfa/losses/NpairsLoss.md                       |    8 -
 .../tfa/losses/NpairsMultilabelLoss.md             |    8 -
 .../tfa/losses/PinballLoss.md                      |   10 +-
 .../tfa/losses/SigmoidFocalCrossEntropy.md         |   12 +-
 .../tfa/losses/TripletHardLoss.md                  |   10 +-
 .../tfa/losses/TripletSemiHardLoss.md              |   10 +-
 .../tfa/losses/WeightedKappaLoss.md                |    8 -
 .../tfa/losses/contrastive.md => dev/null}         |   40 -
 .../tfa/losses/contrastive_loss.md                 |   14 +-
 .../tfa/losses/focal_loss.md => dev/null}          |   40 -
 .../tfa/losses/giou_loss.md                        |    4 +-
 .../tfa/losses/kappa_loss.md => dev/null}          |   34 -
 .../addons_api/tfa/losses/lifted.md => dev/null}   |   40 -
 .../tfa/losses/lifted_struct_loss.md               |   14 +-
 .../angular_distance.md => dev/null}               |   69 -
 .../pairwise_distance.md => dev/null}              |   77 -
 .../tfa/losses/metric_learning.md => dev/null}     |   36 -
 .../addons_api/tfa/losses/npairs.md => dev/null}   |   42 -
 .../tfa/losses/npairs_loss.md                      |   12 +-
 .../tfa/losses/npairs_multilabel_loss.md           |   12 +-
 .../tfa/losses/pinball_loss.md                     |   14 +-
 .../tfa/losses/quantiles.md => dev/null}           |   40 -
 .../tfa/losses/sigmoid_focal_crossentropy.md       |   16 +-
 .../tfa/losses/sparsemax_loss.md                   |    6 +-
 .../addons_api/tfa/losses/triplet.md => dev/null}  |   44 -
 .../tfa/losses/triplet_hard_loss.md                |   14 +-
 .../tfa/losses/triplet_semihard_loss.md            |   14 +-
 .../{addons_api => new_addons_api}/tfa/losses.md   |   18 -
 .../tfa/metrics/CohenKappa.md                      |   12 +-
 .../tfa/metrics/F1Score.md                         |   12 +-
 .../tfa/metrics/FBetaScore.md                      |   14 +-
 .../tfa/metrics/GeometricMean.md                   |   10 +-
 .../tfa/metrics/HammingLoss.md                     |   10 +-
 .../tfa/metrics/MatthewsCorrelationCoefficient.md  |   12 +-
 .../tfa/metrics/MeanMetricWrapper.md               |   10 +-
 .../tfa/metrics/MultiLabelConfusionMatrix.md       |   12 +-
 .../tfa/metrics/RSquare.md                         |   10 +-
 .../tfa/metrics/cohens_kappa.md => dev/null}       |   36 -
 .../tfa/metrics/f_scores.md => dev/null}           |   38 -
 .../tfa/metrics/geometric_mean.md => dev/null}     |   34 -
 .../hamming/hamming_loss_fn.md => dev/null}        |  128 -
 .../addons_api/tfa/metrics/hamming.md => dev/null} |   44 -
 .../tfa/metrics/hamming_distance.md                |   12 +-
 .../null}                                          |   36 -
 .../multilabel_confusion_matrix.md => dev/null}    |   36 -
 .../tfa/metrics/r_square.md => dev/null}           |   38 -
 .../sample_weight_shape_match.md => dev/null}      |   31 -
 .../addons_api/tfa/metrics/utils.md => dev/null}   |   38 -
 .../{addons_api => new_addons_api}/tfa/metrics.md  |   18 -
 .../tfa/optimizers/AdamW.md                        |   12 +-
 .../tfa/optimizers/AveragedOptimizerWrapper.md     |   10 +-
 .../tfa/optimizers/ConditionalGradient.md          |   10 +-
 .../tfa/optimizers/CyclicalLearningRate.md         |   10 +-
 .../optimizers/ExponentialCyclicalLearningRate.md  |   12 +-
 .../tfa/optimizers/LAMB.md                         |   16 +-
 .../tfa/optimizers/LazyAdam.md                     |   14 +-
 .../tfa/optimizers/Lookahead.md                    |   12 +-
 .../tfa/optimizers/MovingAverage.md                |   12 +-
 .../tfa/optimizers/NovoGrad.md                     |   16 +-
 .../tfa/optimizers/ProximalAdagrad.md              |    8 -
 .../tfa/optimizers/RectifiedAdam.md                |   20 +-
 .../tfa/optimizers/SGDW.md                         |   10 -
 .../tfa/optimizers/SWA.md                          |   10 +-
 .../optimizers/Triangular2CyclicalLearningRate.md  |   10 +-
 .../optimizers/TriangularCyclicalLearningRate.md   |   10 +-
 .../tfa/optimizers/Yogi.md                         |   20 +-
 .../tfa/optimizers/average_wrapper.md => dev/null} |   28 -
 .../conditional_gradient.md => dev/null}           |   34 -
 .../cyclical_learning_rate.md => dev/null}         |   40 -
 .../extend_with_decoupled_weight_decay.md          |    8 -
 .../addons_api/tfa/optimizers/lamb.md => dev/null} |   36 -
 .../tfa/optimizers/lazy_adam.md => dev/null}       |   38 -
 .../tfa/optimizers/lookahead.md => dev/null}       |   28 -
 .../tfa/optimizers/moving_average.md => dev/null}  |   28 -
 .../tfa/optimizers/novograd.md => dev/null}        |   34 -
 .../optimizers/proximal_adagrad.md => dev/null}    |   34 -
 .../tfa/optimizers/rectified_adam.md => dev/null}  |   34 -
 .../stochastic_weight_averaging.md => dev/null}    |   37 -
 .../DecoupledWeightDecayExtension.md => dev/null}  |  345 --
 .../weight_decay_optimizers.md => dev/null}        |   42 -
 .../addons_api/tfa/optimizers/yogi.md => dev/null} |   40 -
 .../tfa/optimizers.md                              |   28 -
 .../tfa/options/warn_fallback.md => dev/null}      |   31 -
 .../windqaq/addons_api/tfa/options.md => dev/null} |   34 -
 .../register_custom_kernels.md => dev/null}        |   29 -
 .../register_keras_objects.md => dev/null}         |   29 -
 .../addons_api/tfa/register.md => dev/null}        |   32 -
 .../tfa}/register_all.md                           |   14 +-
 .../tfa/rnn/ESNCell.md                             |   16 +-
 .../tfa/rnn/LayerNormLSTMCell.md                   |   42 +-
 .../tfa/rnn/LayerNormSimpleRNNCell.md              |   42 +-
 .../tfa/rnn/NASCell.md                             |   18 +-
 .../tfa/rnn/PeepholeLSTMCell.md                    |    8 -
 .../addons_api/tfa/rnn/esn_cell.md => dev/null}    |   36 -
 .../tfa/rnn/layer_norm_lstm_cell.md => dev/null}   |   44 -
 .../rnn/layer_norm_simple_rnn_cell.md => dev/null} |   44 -
 .../addons_api/tfa/rnn/nas_cell.md => dev/null}    |   38 -
 .../tfa/rnn/peephole_lstm_cell.md => dev/null}     |   30 -
 .../{addons_api => new_addons_api}/tfa/rnn.md      |   12 -
 .../tfa/seq2seq/AttentionMechanism.md              |    8 -
 .../tfa/seq2seq/AttentionWrapper.md                |    8 -
 .../tfa/seq2seq/AttentionWrapperState.md           |    8 -
 .../tfa/seq2seq/BahdanauAttention.md               |   14 +-
 .../tfa/seq2seq/BahdanauMonotonicAttention.md      |   18 +-
 .../tfa/seq2seq/BaseDecoder.md                     |    8 -
 .../tfa/seq2seq/BasicDecoder.md                    |    8 -
 .../tfa/seq2seq/BasicDecoderOutput.md              |    8 -
 .../tfa/seq2seq/BeamSearchDecoder.md               |   14 +-
 .../tfa/seq2seq/BeamSearchDecoderOutput.md         |    8 -
 .../tfa/seq2seq/BeamSearchDecoderState.md          |    8 -
 .../tfa/seq2seq/CustomSampler.md                   |   12 +-
 .../tfa/seq2seq/Decoder.md                         |    8 -
 .../tfa/seq2seq/FinalBeamSearchDecoderOutput.md    |    8 -
 .../tfa/seq2seq/GreedyEmbeddingSampler.md          |    8 -
 .../tfa/seq2seq/InferenceSampler.md                |   12 +-
 .../tfa/seq2seq/LuongAttention.md                  |   12 +-
 .../tfa/seq2seq/LuongMonotonicAttention.md         |   16 +-
 .../tfa/seq2seq/SampleEmbeddingSampler.md          |    8 -
 .../tfa/seq2seq/Sampler.md                         |    8 -
 .../seq2seq/ScheduledEmbeddingTrainingSampler.md   |   10 +-
 .../tfa/seq2seq/ScheduledOutputTrainingSampler.md  |   10 +-
 .../tfa/seq2seq/SequenceLoss.md                    |    8 -
 .../tfa/seq2seq/TrainingSampler.md                 |    8 -
 .../tfa/seq2seq/attention_wrapper.md => dev/null}  |   62 -
 .../tfa/seq2seq/basic_decoder.md => dev/null}      |   32 -
 .../BeamSearchDecoderMixin.md => dev/null}         |  318 -
 .../null}                                          |   66 -
 .../get_attention_probs.md => dev/null}            |   92 -
 .../seq2seq/beam_search_decoder.md => dev/null}    |   58 -
 .../addons_api/tfa/seq2seq/decoder.md => dev/null} |   40 -
 .../tfa/seq2seq/dynamic_decode.md                  |    8 -
 .../tfa/seq2seq/gather_tree.md                     |   16 +-
 .../tfa/seq2seq/gather_tree_from_array.md          |   14 +-
 .../tfa/seq2seq/hardmax.md                         |   10 +-
 .../addons_api/tfa/seq2seq/loss.md => dev/null}    |   38 -
 .../tfa/seq2seq/monotonic_attention.md             |   12 +-
 .../tfa/seq2seq/safe_cumprod.md                    |   10 +-
 .../sampler/bernoulli_sample.md => dev/null}       |   33 -
 .../sampler/categorical_sample.md => dev/null}     |   33 -
 .../addons_api/tfa/seq2seq/sampler.md => dev/null} |   56 -
 .../tfa/seq2seq/sequence_loss.md                   |   14 +-
 .../tfa/seq2seq/tile_batch.md                      |   10 +-
 .../{addons_api => new_addons_api}/tfa/seq2seq.md  |   14 -
 .../crf/CrfDecodeForwardRnnCell.md => dev/null}    | 1053 ----
 .../addons_api/tfa/text/crf.md => dev/null}        |   56 -
 .../tfa/text/crf_binary_score.md                   |   14 +-
 .../tfa/text/crf_decode.md                         |   14 +-
 .../tfa/text/crf_decode_backward.md                |   12 +-
 .../tfa/text/crf_decode_forward.md                 |   16 +-
 .../tfa/text/crf_forward.md                        |   16 +-
 .../tfa/text/crf_log_likelihood.md                 |   14 +-
 .../tfa/text/crf_log_norm.md                       |   14 +-
 .../tfa/text/crf_multitag_sequence_score.md        |   16 +-
 .../tfa/text/crf_sequence_score.md                 |   16 +-
 .../tfa/text/crf_unary_score.md                    |   14 +-
 .../tfa/text/parse_time.md                         |    8 -
 .../tfa/text/parse_time_op.md => dev/null}         |   34 -
 .../tfa/text/skip_gram_ops.md => dev/null}         |   40 -
 .../tfa/text/skip_gram_sample.md                   |   18 +-
 .../tfa/text/skip_gram_sample_with_text_vocab.md   |   22 +-
 .../tfa/text/viterbi_decode.md                     |   12 +-
 .../{addons_api => new_addons_api}/tfa/text.md     |    8 -
 .../tfa/types}/AcceptableDTypes.md                 |    4 +-
 .../esn => new_addons_api/tfa/types}/Activation.md |    4 +-
 .../tfa/types/Constraint.md}                       |    6 +-
 .../tfa/types}/FloatTensorLike.md                  |    4 +-
 .../tfa/types}/Number.md                           |    4 +-
 .../windqaq/new_addons_api/tfa/types/Optimizer.md} |   32 +
 .../tfa/types}/TensorLike.md                       |    4 +-
 .../windqaq/new_addons_api/tfa/types.md}           |   46 +
 .../windqaq/{addons_api => new_addons_api}/tfa.md  |    8 +-
 280 files changed, 485 insertions(+), 17753 deletions(-)

@MarkDaoust
Copy link
Member

SGTM.

Sorry that diff's not as clear as I was hoping... if you diff the git diff the generated _toc.yaml that might show more clearly what's changed.

@WindQAQ
Copy link
Member Author

WindQAQ commented Sep 15, 2020

SGTM.

Sorry that diff's not as clear as I was hoping... if you diff the git diff the generated _toc.yaml that might show more clearly what's changed.

Here it is.

Diff TOC

diff --git a/home/windqaq/addons_api/_toc.yaml b/home/windqaq/new_addons_api/_toc.yaml
index 7c9c58a..45ee1f7 100644
--- a/home/windqaq/addons_api/_toc.yaml
+++ b/home/windqaq/new_addons_api/_toc.yaml
@@ -3,6 +3,8 @@ toc:
   section:
   - title: Overview
     path: /addons/api_docs/python/tfa
+  - title: register_all
+    path: /addons/api_docs/python/tfa/register_all
 - title: tfa.activations
   section:
   - title: Overview
@@ -35,18 +37,6 @@ toc:
     path: /addons/api_docs/python/tfa/callbacks/TimeStopping
   - title: TQDMProgressBar
     path: /addons/api_docs/python/tfa/callbacks/TQDMProgressBar
-  - title: average_model_checkpoint
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/callbacks/average_model_checkpoint
-  - title: time_stopping
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/callbacks/time_stopping
-  - title: tqdm_progress_bar
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/callbacks/tqdm_progress_bar
 - title: tfa.image
   section:
   - title: Overview
@@ -97,76 +87,6 @@ toc:
     path: /addons/api_docs/python/tfa/image/translate
   - title: translate_xy
     path: /addons/api_docs/python/tfa/image/translate_xy
-  - title: color_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/color_ops
-    - title: equalize_image
-      path: /addons/api_docs/python/tfa/image/color_ops/equalize_image
-    - title: Number
-      path: /addons/api_docs/python/tfa/image/color_ops/Number
-    - title: sharpness_image
-      path: /addons/api_docs/python/tfa/image/color_ops/sharpness_image
-    - title: TensorLike
-      path: /addons/api_docs/python/tfa/image/color_ops/TensorLike
-  - title: compose_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/compose_ops
-  - title: cutout_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/cutout_ops
-  - title: distance_transform
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/distance_transform
-  - title: distort_image_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/distort_image_ops
-  - title: filters
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/filters
-    - title: FloatTensorLike
-      path: /addons/api_docs/python/tfa/image/filters/FloatTensorLike
-  - title: resampler_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/resampler_ops
-  - title: transform_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/transform_ops
-    - title: angles_to_projective_transforms
-      path: /addons/api_docs/python/tfa/image/transform_ops/angles_to_projective_transforms
-    - title: compose_transforms
-      path: /addons/api_docs/python/tfa/image/transform_ops/compose_transforms
-    - title: flat_transforms_to_matrices
-      path: /addons/api_docs/python/tfa/image/transform_ops/flat_transforms_to_matrices
-    - title: matrices_to_flat_transforms
-      path: /addons/api_docs/python/tfa/image/transform_ops/matrices_to_flat_transforms
-  - title: translate_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/translate_ops
-    - title: translations_to_projective_transforms
-      path: /addons/api_docs/python/tfa/image/translate_ops/translations_to_projective_transforms
-  - title: utils
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/image/utils
-    - title: from_4D_image
-      path: /addons/api_docs/python/tfa/image/utils/from_4D_image
-    - title: get_ndims
-      path: /addons/api_docs/python/tfa/image/utils/get_ndims
-    - title: to_4D_image
-      path: /addons/api_docs/python/tfa/image/utils/to_4D_image
-    - title: unwrap
-      path: /addons/api_docs/python/tfa/image/utils/unwrap
-    - title: wrap
-      path: /addons/api_docs/python/tfa/image/utils/wrap
 - title: tfa.layers
   section:
   - title: Overview
@@ -215,76 +135,6 @@ toc:
     path: /addons/api_docs/python/tfa/layers/TLU
   - title: WeightNormalization
     path: /addons/api_docs/python/tfa/layers/WeightNormalization
-  - title: adaptive_pooling
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/adaptive_pooling
-    - title: AdaptivePooling1D
-      path: /addons/api_docs/python/tfa/layers/adaptive_pooling/AdaptivePooling1D
-    - title: AdaptivePooling2D
-      path: /addons/api_docs/python/tfa/layers/adaptive_pooling/AdaptivePooling2D
-    - title: AdaptivePooling3D
-      path: /addons/api_docs/python/tfa/layers/adaptive_pooling/AdaptivePooling3D
-  - title: esn
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/esn
-    - title: Activation
-      path: /addons/api_docs/python/tfa/layers/esn/Activation
-    - title: Initializer
-      path: /addons/api_docs/python/tfa/layers/esn/Initializer
-  - title: gelu
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/gelu
-  - title: maxout
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/maxout
-  - title: multihead_attention
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/multihead_attention
-  - title: normalizations
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/normalizations
-  - title: optical_flow
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/optical_flow
-  - title: poincare
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/poincare
-  - title: polynomial
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/polynomial
-  - title: snake
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/snake
-  - title: sparsemax
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/sparsemax
-  - title: spatial_pyramid_pooling
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/spatial_pyramid_pooling
-  - title: spectral_normalization
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/spectral_normalization
-  - title: tlu
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/tlu
-  - title: wrappers
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/layers/wrappers
 - title: tfa.losses
   section:
   - title: Overview
@@ -331,42 +181,6 @@ toc:
     path: /addons/api_docs/python/tfa/losses/triplet_semihard_loss
   - title: WeightedKappaLoss
     path: /addons/api_docs/python/tfa/losses/WeightedKappaLoss
-  - title: contrastive
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/contrastive
-  - title: focal_loss
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/focal_loss
-  - title: kappa_loss
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/kappa_loss
-  - title: lifted
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/lifted
-  - title: metric_learning
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/metric_learning
-    - title: angular_distance
-      path: /addons/api_docs/python/tfa/losses/metric_learning/angular_distance
-    - title: pairwise_distance
-      path: /addons/api_docs/python/tfa/losses/metric_learning/pairwise_distance
-  - title: npairs
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/npairs
-  - title: quantiles
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/quantiles
-  - title: triplet
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/losses/triplet
 - title: tfa.metrics
   section:
   - title: Overview
@@ -391,44 +205,6 @@ toc:
     path: /addons/api_docs/python/tfa/metrics/MultiLabelConfusionMatrix
   - title: RSquare
     path: /addons/api_docs/python/tfa/metrics/RSquare
-  - title: cohens_kappa
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/cohens_kappa
-    - title: AcceptableDTypes
-      path: /addons/api_docs/python/tfa/metrics/cohens_kappa/AcceptableDTypes
-  - title: f_scores
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/f_scores
-  - title: geometric_mean
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/geometric_mean
-  - title: hamming
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/hamming
-    - title: hamming_loss_fn
-      path: /addons/api_docs/python/tfa/metrics/hamming/hamming_loss_fn
-  - title: matthews_correlation_coefficient
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/matthews_correlation_coefficient
-  - title: multilabel_confusion_matrix
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/multilabel_confusion_matrix
-  - title: r_square
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/r_square
-  - title: utils
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/metrics/utils
-    - title: sample_weight_shape_match
-      path: /addons/api_docs/python/tfa/metrics/utils/sample_weight_shape_match
 - title: tfa.optimizers
   section:
   - title: Overview
@@ -469,76 +245,6 @@ toc:
     path: /addons/api_docs/python/tfa/optimizers/TriangularCyclicalLearningRate
   - title: Yogi
     path: /addons/api_docs/python/tfa/optimizers/Yogi
-  - title: average_wrapper
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/average_wrapper
-  - title: conditional_gradient
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/conditional_gradient
-  - title: cyclical_learning_rate
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/cyclical_learning_rate
-  - title: lamb
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/lamb
-  - title: lazy_adam
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/lazy_adam
-  - title: lookahead
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/lookahead
-  - title: moving_average
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/moving_average
-  - title: novograd
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/novograd
-  - title: proximal_adagrad
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/proximal_adagrad
-  - title: rectified_adam
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/rectified_adam
-  - title: stochastic_weight_averaging
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/stochastic_weight_averaging
-  - title: weight_decay_optimizers
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/weight_decay_optimizers
-    - title: DecoupledWeightDecayExtension
-      path: /addons/api_docs/python/tfa/optimizers/weight_decay_optimizers/DecoupledWeightDecayExtension
-  - title: yogi
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/optimizers/yogi
-- title: tfa.options
-  section:
-  - title: Overview
-    path: /addons/api_docs/python/tfa/options
-  - title: warn_fallback
-    path: /addons/api_docs/python/tfa/options/warn_fallback
-- title: tfa.register
-  section:
-  - title: Overview
-    path: /addons/api_docs/python/tfa/register
-  - title: register_all
-    path: /addons/api_docs/python/tfa/register/register_all
-  - title: register_custom_kernels
-    path: /addons/api_docs/python/tfa/register/register_custom_kernels
-  - title: register_keras_objects
-    path: /addons/api_docs/python/tfa/register/register_keras_objects
 - title: tfa.rnn
   section:
   - title: Overview
@@ -553,26 +259,6 @@ toc:
     path: /addons/api_docs/python/tfa/rnn/NASCell
   - title: PeepholeLSTMCell
     path: /addons/api_docs/python/tfa/rnn/PeepholeLSTMCell
-  - title: esn_cell
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/rnn/esn_cell
-  - title: layer_norm_lstm_cell
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/rnn/layer_norm_lstm_cell
-  - title: layer_norm_simple_rnn_cell
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/rnn/layer_norm_simple_rnn_cell
-  - title: nas_cell
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/rnn/nas_cell
-  - title: peephole_lstm_cell
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/rnn/peephole_lstm_cell
 - title: tfa.seq2seq
   section:
   - title: Overview
@@ -641,40 +327,6 @@ toc:
     path: /addons/api_docs/python/tfa/seq2seq/tile_batch
   - title: TrainingSampler
     path: /addons/api_docs/python/tfa/seq2seq/TrainingSampler
-  - title: attention_wrapper
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/seq2seq/attention_wrapper
-  - title: basic_decoder
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/seq2seq/basic_decoder
-  - title: beam_search_decoder
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/seq2seq/beam_search_decoder
-    - title: attention_probs_from_attn_state
-      path: /addons/api_docs/python/tfa/seq2seq/beam_search_decoder/attention_probs_from_attn_state
-    - title: BeamSearchDecoderMixin
-      path: /addons/api_docs/python/tfa/seq2seq/beam_search_decoder/BeamSearchDecoderMixin
-    - title: get_attention_probs
-      path: /addons/api_docs/python/tfa/seq2seq/beam_search_decoder/get_attention_probs
-  - title: decoder
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/seq2seq/decoder
-  - title: loss
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/seq2seq/loss
-  - title: sampler
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/seq2seq/sampler
-    - title: bernoulli_sample
-      path: /addons/api_docs/python/tfa/seq2seq/sampler/bernoulli_sample
-    - title: categorical_sample
-      path: /addons/api_docs/python/tfa/seq2seq/sampler/categorical_sample
 - title: tfa.text
   section:
   - title: Overview
@@ -707,17 +359,21 @@ toc:
     path: /addons/api_docs/python/tfa/text/skip_gram_sample_with_text_vocab
   - title: viterbi_decode
     path: /addons/api_docs/python/tfa/text/viterbi_decode
-  - title: crf
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/text/crf
-    - title: CrfDecodeForwardRnnCell
-      path: /addons/api_docs/python/tfa/text/crf/CrfDecodeForwardRnnCell
-  - title: parse_time_op
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/text/parse_time_op
-  - title: skip_gram_ops
-    section:
-    - title: Overview
-      path: /addons/api_docs/python/tfa/text/skip_gram_ops
+- title: tfa.types
+  section:
+  - title: Overview
+    path: /addons/api_docs/python/tfa/types
+  - title: AcceptableDTypes
+    path: /addons/api_docs/python/tfa/types/AcceptableDTypes
+  - title: Activation
+    path: /addons/api_docs/python/tfa/types/Activation
+  - title: Constraint
+    path: /addons/api_docs/python/tfa/types/Constraint
+  - title: FloatTensorLike
+    path: /addons/api_docs/python/tfa/types/FloatTensorLike
+  - title: Number
+    path: /addons/api_docs/python/tfa/types/Number
+  - title: Optimizer
+    path: /addons/api_docs/python/tfa/types/Optimizer
+  - title: TensorLike
+    path: /addons/api_docs/python/tfa/types/TensorLike

@MarkDaoust
Copy link
Member

Cool thanks,

So this looks mostly like a good change. But there are a few objects that will be dropped from the docs, many of these look like they are meant to be public, so if we are making this change you will need to add the missing imports to get the ones that are meant to be public to show up in the generated docs.

tfa/image/color_ops
image/filters/FloatTensorLike
tfa/image/transform_ops
tfa/image/translate_ops/translations_to_projective_transforms
tfa/image/utils
tfa/losses/metric_learning
tfa/metrics/hamming/hamming_loss_fn
tfa/metrics/utils/sample_weight_shape_match
tfa/optimizers/weight_decay_optimizers/DecoupledWeightDecayExtension
tfa/options/warn_fallback
tfa/register
tfa/seq2seq/beam_search_decoder
tfa/seq2seq/sampler
tfa/text/crf

We could use some feedback from the addons team here to indicate which of these are meant for public consumption.

@WindQAQ
Copy link
Member Author

WindQAQ commented Sep 15, 2020

Cool thanks,

So this looks mostly like a good change. But there are a few objects that will be dropped from the docs, many of these look like they are meant to be public, so if we are making this change you will need to add the missing imports to get the ones that are meant to be public to show up in the generated docs.

tfa/image/color_ops
image/filters/FloatTensorLike
tfa/image/transform_ops
tfa/image/translate_ops/translations_to_projective_transforms
tfa/image/utils
tfa/losses/metric_learning
tfa/metrics/hamming/hamming_loss_fn
tfa/metrics/utils/sample_weight_shape_match
tfa/optimizers/weight_decay_optimizers/DecoupledWeightDecayExtension
tfa/options/warn_fallback
tfa/register
tfa/seq2seq/beam_search_decoder
tfa/seq2seq/sampler
tfa/text/crf

We could use some feedback from the addons team here to indicate which of these are meant for public consumption.

Yep, some modules should be public. We'll clean it up and discuss it. Thank you!

@WindQAQ
Copy link
Member Author

WindQAQ commented Sep 22, 2020

@tensorflow/sig-addons-maintainers I have listed all modules to be discussed down below. Any comment on this? Thank you!

  • tfa/image/color_ops
    • Drop: equalize and sharpness already exported.
  • image/filters/FloatTensorLike
    • Drop: this is just the alias of tfa.utils.types.*
  • tfa/image/transform_ops
    • Expose
      • compose_transforms: Useful utility when users want to compose many transformation.
      • angles_to_projective_transforms: Convert angles to transformation matrix.
  • tfa/image/translate_ops/translations_to_projective_transforms
    • Expose
      • translations_to_projective_transforms: Convert translations to transformation matrix.
  • tfa/image/utils
    • Drop: internal utility
  • tfa/losses/metric_learning
    • Drop? People can use different distance through distance argument for triplet loss.
  • tfa/metrics/hamming/hamming_loss_fn
    • Expose? I think it's better to name this hamming_loss instead of hamming_loss_fn for consistency.
  • tfa/metrics/utils/sample_weight_shape_match
    • Drop: internal utility
  • tfa/optimizers/weight_decay_optimizers/DecoupledWeightDecayExtension
    • Expose: this is the wrapper of weight decay optimizer.
  • tfa/options/warn_fallback
    • Drop: internal use.
  • tfa/register
    • Drop: tfa.register_all() has already been exposed.
  • tfa/seq2seq/beam_search_decoder
    • Drop: main functions/classes have already been exposed to tfa.seq2seq.
  • tfa/seq2seq/sampler
    • Drop: main functions/classes have already been exposed to tfa.seq2seq.
  • tfa/text/crf:
    • Expose? maybe export tfa.text.crf.CrfDecodeForwardRnnCell as tfa.text.CrfDecodeForwardRnnCell?

@WindQAQ
Copy link
Member Author

WindQAQ commented Oct 8, 2020

Hmm, team tagging is not so useful. @seanpmorgan @bhack Can you review the comments above when time allows, I would like to move this forward. Thank you!

@bhack
Copy link
Contributor

bhack commented Oct 8, 2020

@WindQAQ It is the risk of https://en.m.wikipedia.org/wiki/Bystander_effect 😄

Can you quickly explain what is this?

@WindQAQ
Copy link
Member Author

WindQAQ commented Oct 8, 2020

@WindQAQ It is the risk of https://en.m.wikipedia.org/wiki/Bystander_effect 😄

Haha, it's not a good effect actually 😆

Can you quickly explain what is this?

Okay, so the problem is orignated in #2132.

In short, decide the public API in #2162 (comment)

TL;DR

Changes:

@bhack
Copy link
Contributor

bhack commented Oct 8, 2020

I think Is ok. I don't know much about CRF and seq2seq.

bhack
bhack previously approved these changes Oct 8, 2020
Copy link
Contributor

@bhack bhack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an extra review for CRF and seq2seq

Copy link
Member

@seanpmorgan seanpmorgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to expose what's listed in the bullets I believe. Going through them now

@seanpmorgan
Copy link
Member

@tensorflow/sig-addons-maintainers I have listed all modules to be discussed down below. Any comment on this? Thank you!

  • tfa/image/color_ops

    • Drop: equalize and sharpness already exported.
  • image/filters/FloatTensorLike

    • Drop: this is just the alias of tfa.utils.types.*
  • tfa/image/transform_ops

    • Expose

      • compose_transforms: Useful utility when users want to compose many transformation.
      • angles_to_projective_transforms: Convert angles to transformation matrix.
  • tfa/image/translate_ops/translations_to_projective_transforms

    • Expose

      • translations_to_projective_transforms: Convert translations to transformation matrix.
  • tfa/image/utils

    • Drop: internal utility
  • tfa/losses/metric_learning

    • Drop? People can use different distance through distance argument for triplet loss.
  • tfa/metrics/hamming/hamming_loss_fn

    • Expose? I think it's better to name this hamming_loss instead of hamming_loss_fn for consistency.
  • tfa/metrics/utils/sample_weight_shape_match

    • Drop: internal utility
  • tfa/optimizers/weight_decay_optimizers/DecoupledWeightDecayExtension

    • Expose: this is the wrapper of weight decay optimizer.
  • tfa/options/warn_fallback

    • Drop: internal use.
  • tfa/register

    • Drop: tfa.register_all() has already been exposed.
  • tfa/seq2seq/beam_search_decoder

    • Drop: main functions/classes have already been exposed to tfa.seq2seq.
  • tfa/seq2seq/sampler

    • Drop: main functions/classes have already been exposed to tfa.seq2seq.
  • tfa/text/crf:

    • Expose? maybe export tfa.text.crf.CrfDecodeForwardRnnCell as tfa.text.CrfDecodeForwardRnnCell?

Agree with all of the above.... only thing I would change would be to expose all public functions in text.crf as I'm not sure of the user adoption and understanding there. One other thought:

  • Expose hamming_loss_fn and we can update the name in another PR (likely need to alias the old name though for backwards compat)

Sorry for the delay forgot to get around to this.

@seanpmorgan
Copy link
Member

@WindQAQ just checking do you think you'll be able to clean up these or would you like someone to pick it up from here? No major rush but was thinking we should get this fixed up prior to Addons pinned to TF2.4

@WindQAQ
Copy link
Member Author

WindQAQ commented Nov 13, 2020

@seanpmorgan Sure, I'll do it in the weekend. Sorry that I'm busy with my course recently 😭

@boring-cyborg boring-cyborg bot added the text label Nov 23, 2020
@WindQAQ
Copy link
Member Author

WindQAQ commented Nov 23, 2020

Hi @seanpmorgan @bhack, I've updated the PR. The updated API is here tfa_api.zip.

Let me now if there is any change needed!

"""Additional text-processing ops."""

# Conditional Random Field
from tensorflow_addons.text import crf
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will generate a page like

<div itemscope itemtype="http://developers.google.com/ReferenceObject">
<meta itemprop="name" content="tfa.text.crf" />
<meta itemprop="path" content="Stable" />
</div>

# Module: tfa.text.crf

<!-- Insert buttons and diff -->

<table class="tfo-notebook-buttons tfo-api nocontent" align="left">
<td>
  <a target="_blank" href="https://github.com/tensorflow/addons/tree/doc/expose-types-doc/tensorflow_addons/text/crf.py">
    <img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
    View source on GitHub
  </a>
</td>
</table>







## Classes

[`class CrfDecodeForwardRnnCell`](../../tfa/text/CrfDecodeForwardRnnCell.md): Computes the forward decoding in a linear-chain CRF.

## Functions

[`crf_binary_score(...)`](../../tfa/text/crf_binary_score.md): Computes the binary scores of tag sequences.

[`crf_constrained_decode(...)`](../../tfa/text/crf_constrained_decode.md): Decode the highest scoring sequence of tags under constraints.

[`crf_decode(...)`](../../tfa/text/crf_decode.md): Decode the highest scoring sequence of tags.

[`crf_decode_backward(...)`](../../tfa/text/crf_decode_backward.md): Computes backward decoding in a linear-chain CRF.

[`crf_decode_forward(...)`](../../tfa/text/crf_decode_forward.md): Computes forward decoding in a linear-chain CRF.

[`crf_filtered_inputs(...)`](../../tfa/text/crf_filtered_inputs.md): Constrains the inputs to filter out certain tags at each time step.

[`crf_forward(...)`](../../tfa/text/crf_forward.md): Computes the alpha values in a linear-chain CRF.

[`crf_log_likelihood(...)`](../../tfa/text/crf_log_likelihood.md): Computes the log-likelihood of tag sequences in a CRF.

[`crf_log_norm(...)`](../../tfa/text/crf_log_norm.md): Computes the normalization for a CRF.

[`crf_multitag_sequence_score(...)`](../../tfa/text/crf_multitag_sequence_score.md): Computes the unnormalized score of all tag sequences matching

[`crf_sequence_score(...)`](../../tfa/text/crf_sequence_score.md): Computes the unnormalized score for a tag sequence.

[`crf_unary_score(...)`](../../tfa/text/crf_unary_score.md): Computes the unary scores of tag sequences.

[`viterbi_decode(...)`](../../tfa/text/viterbi_decode.md): Decode the highest scoring sequence of tags outside of TensorFlow.

## Type Aliases

[`TensorLike`](../../tfa/types/TensorLike.md): The central part of internal API.

which redirects APIs to lower page tfa.text.*.

Note that even if we do not import APIs in __init__.py, the users can still access it as usual. This is just for better look of API pages.

Copy link
Member

@seanpmorgan seanpmorgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@seanpmorgan seanpmorgan merged commit 83cbddc into tensorflow:master Nov 23, 2020
jrruijli pushed a commit to jrruijli/addons that referenced this pull request Dec 23, 2020
* Expose tfa.types
* Fix comment
* Expose to public API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated documentation of type aliases are included in unrelated modules

5 participants