diff --git a/bob/learn/tensorflow/data/generator.py b/bob/learn/tensorflow/data/generator.py index 7e68c0246eb227862f6d79214c1000caaa6a8561..bcf0e79aad70d5ffe004e97af88621c29851eb10 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 894a461200639042094c6b9e29e1721eee1478cb..a6da47f618c0ba87ef7e41e44fdb2af58a022916 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 3589e5c2a88cea6c0c41831c2c5339eefd073bce..4d519b031adaa9f7512abf3328a24be22319d739 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 2fec97b9c55bcd617d16a2cef044b327c3007560..6cf7d2859bb0123af75c09d651f27455c1c6c360 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