From 2ad6d5d05a87cb5d6026bd57356b8e95c1c54f0a Mon Sep 17 00:00:00 2001
From: Tiago Freitas Pereira <tiagofrepereira@gmail.com>
Date: Fri, 13 Nov 2020 11:33:24 +0100
Subject: [PATCH] [sphinx] Fixed warnings

[sphinx] Clean up

[sphinx] Clean up
---
 bob/learn/tensorflow/data/generator.py     |  8 +--
 bob/learn/tensorflow/losses/center_loss.py | 13 +++-
 doc/nitpick-exceptions.txt                 |  2 +
 doc/py_api.rst                             | 69 ++++------------------
 4 files changed, 27 insertions(+), 65 deletions(-)

diff --git a/bob/learn/tensorflow/data/generator.py b/bob/learn/tensorflow/data/generator.py
index 7e68c024..bcf0e79a 100644
--- a/bob/learn/tensorflow/data/generator.py
+++ b/bob/learn/tensorflow/data/generator.py
@@ -14,21 +14,21 @@ class Generator:
     ----------
     epoch : int
         The number of epochs that have been passed so far.
+
     multiple_samples : :obj:`bool`, optional
         If true, it assumes that the bio database's samples actually contain
         multiple samples. This is useful for when you want to for example treat
         video databases as image databases.
+
     reader : :obj:`object`, optional
         A callable with the signature of ``data, label, key = reader(sample)``
         which takes a sample and loads it.
+
     samples : [:obj:`object`]
         A list of samples to be given to ``reader`` to load the data.
+
     shuffle_on_epoch_end : :obj:`bool`, optional
         If True, it shuffle the samples at the end of each epoch.
-    output_types : (object, object, object)
-        The types of the returned samples.
-    output_shapes : ``(tf.TensorShape, tf.TensorShape, tf.TensorShape)``
-        The shapes of the returned samples.
     """
 
     def __init__(
diff --git a/bob/learn/tensorflow/losses/center_loss.py b/bob/learn/tensorflow/losses/center_loss.py
index 894a4612..a6da47f6 100644
--- a/bob/learn/tensorflow/losses/center_loss.py
+++ b/bob/learn/tensorflow/losses/center_loss.py
@@ -6,10 +6,12 @@ class CenterLossLayer(tf.keras.layers.Layer):
 
     Attributes
     ----------
-    centers : tf.Variable
+    centers:
         The variable that keeps track of centers.
+
     n_classes : int
         Number of classes of the task.
+
     n_features : int
         The size of prelogits.
     """
@@ -49,12 +51,17 @@ class CenterLoss(tf.keras.losses.Loss):
 
     Attributes
     ----------
-    alpha : float
+    alpha: float
         The moving average coefficient for updating centers in each batch.
-    centers : tf.Variable
+
+    centers
         The variable that keeps track of centers.
+
     centers_layer
         The layer that keeps track of centers.
+
+    update_centers: bool
+        Update the centers? Used at training
     """
 
     def __init__(
diff --git a/doc/nitpick-exceptions.txt b/doc/nitpick-exceptions.txt
index 3589e5c2..4d519b03 100644
--- a/doc/nitpick-exceptions.txt
+++ b/doc/nitpick-exceptions.txt
@@ -2,3 +2,5 @@ py:class list
 py:exc ValueError
 py:class tensorflow.python.estimator.estimator.Estimator
 py:class tensorflow_estimator.python.estimator.estimator.Estimator
+py:class tensorflow.python.keras.losses.Loss
+py:class tensorflow.python.keras.engine.base_layer.Layer
diff --git a/doc/py_api.rst b/doc/py_api.rst
index 2fec97b9..6cf7d285 100644
--- a/doc/py_api.rst
+++ b/doc/py_api.rst
@@ -7,63 +7,27 @@
 ============
 
 
-Estimators
-==========
-
-.. autosummary::
-    bob.learn.tensorflow.estimators.Logits
-    bob.learn.tensorflow.estimators.LogitsCenterLoss
-    bob.learn.tensorflow.estimators.Triplet
-    bob.learn.tensorflow.estimators.Siamese
-    bob.learn.tensorflow.estimators.Regressor
-    bob.learn.tensorflow.estimators.MovingAverageOptimizer
-    bob.learn.tensorflow.estimators.learning_rate_decay_fn
-
-
-
-Architectures
-=============
-
+Models
+======
 
+.. todo:
+  Summary the models
 
 Data
 ====
 
 .. autosummary::
-    bob.learn.tensorflow.dataset.bio.BioGenerator
-    bob.learn.tensorflow.dataset.image.shuffle_data_and_labels_image_augmentation
-    bob.learn.tensorflow.dataset.siamese_image.shuffle_data_and_labels_image_augmentation
-    bob.learn.tensorflow.dataset.triplet_image.shuffle_data_and_labels_image_augmentation
-    bob.learn.tensorflow.dataset.tfrecords.shuffle_data_and_labels_image_augmentation
-    bob.learn.tensorflow.dataset.tfrecords.shuffle_data_and_labels
-    bob.learn.tensorflow.dataset.generator.dataset_using_generator
-    bob.learn.tensorflow.utils.util.to_channels_last
-    bob.learn.tensorflow.utils.util.to_channels_first
-
-
-Style Transfer
-==============
-
-.. autosummary::
-    bob.learn.tensorflow.style_transfer.do_style_transfer
+    bob.learn.tensorflow.data.dataset_using_generator
+    bob.learn.tensorflow.data.dataset_to_tfrecord
+    bob.learn.tensorflow.data.dataset_from_tfrecord
 
 
 Losses
 ======
 
 .. autosummary::
-    bob.learn.tensorflow.loss.mean_cross_entropy_loss
-    bob.learn.tensorflow.loss.mean_cross_entropy_center_loss
-    bob.learn.tensorflow.loss.contrastive_loss
-    bob.learn.tensorflow.loss.triplet_loss
-    bob.learn.tensorflow.loss.triplet_average_loss
-    bob.learn.tensorflow.loss.triplet_fisher_loss
-    bob.learn.tensorflow.loss.linear_gram_style_loss
-    bob.learn.tensorflow.loss.content_loss
-    bob.learn.tensorflow.loss.denoising_loss
-    bob.learn.tensorflow.loss.balanced_softmax_cross_entropy_loss_weights
-    bob.learn.tensorflow.loss.balanced_sigmoid_cross_entropy_loss_weights
-
+    bob.learn.tensorflow.losses.CenterLossLayer
+    bob.learn.tensorflow.losses.CenterLoss
 
 
 
@@ -71,17 +35,6 @@ Detailed Information
 ====================
 
 .. automodule:: bob.learn.tensorflow
-.. automodule:: bob.learn.tensorflow.estimators
-.. automodule:: bob.learn.tensorflow.dataset
-.. automodule:: bob.learn.tensorflow.dataset.generator
-.. automodule:: bob.learn.tensorflow.dataset.bio
-.. automodule:: bob.learn.tensorflow.dataset.image
-.. automodule:: bob.learn.tensorflow.dataset.siamese_image
-.. automodule:: bob.learn.tensorflow.dataset.triplet_image
-.. automodule:: bob.learn.tensorflow.dataset.tfrecords
-.. automodule:: bob.learn.tensorflow.network
-.. automodule:: bob.learn.tensorflow.network.SimpleCNN
+.. automodule:: bob.learn.tensorflow.data
 .. automodule:: bob.learn.tensorflow.utils
-.. automodule:: bob.learn.tensorflow.utils.util
-.. automodule:: bob.learn.tensorflow.style_transfer
-.. automodule:: bob.learn.tensorflow.loss
+.. automodule:: bob.learn.tensorflow.losses
-- 
GitLab