Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.learn.tensorflow
Commits
88eea1d2
Commit
88eea1d2
authored
May 02, 2019
by
Amir MOHAMMADI
Browse files
Trun nitpicky back on!
parent
7e2d37d7
Pipeline
#29816
failed with stage
in 156 minutes and 6 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/learn/tensorflow/dataset/tfrecords.py
View file @
88eea1d2
...
...
@@ -44,7 +44,7 @@ def dataset_to_tfrecord(dataset, output):
Parameters
----------
dataset : tf.data.Dataset
dataset :
``
tf.data.Dataset
``
The tf.data.Dataset that you want to write into a TFRecord file.
output : str
Path to the TFRecord file. Besides this file, a .json file is also created.
...
...
@@ -53,7 +53,7 @@ def dataset_to_tfrecord(dataset, output):
Returns
-------
tf.Operation
``
tf.Operation
``
A tf.Operation that, when run, writes contents of dataset to a file. When
running in eager mode, calling this function will write the file. Otherwise, you
have to call session.run() on the returned operation.
...
...
@@ -100,7 +100,7 @@ def dataset_from_tfrecord(tfrecord):
Returns
-------
tf.data.Dataset
``
tf.data.Dataset
``
A dataset that contains the data from the TFRecord file.
"""
# these imports are needed so that eval can work
...
...
@@ -468,7 +468,8 @@ def batch_data_and_labels(
"""
Dump in order batches from a list of tf-record files
**Parameters**
Parameters
----------
tfrecord_filenames:
List containing the tf-record paths
...
...
bob/learn/tensorflow/loss/utils.py
View file @
88eea1d2
...
...
@@ -15,17 +15,17 @@ def balanced_softmax_cross_entropy_loss_weights(labels, dtype="float32"):
Parameters
----------
labels : tf.Tensor
labels :
``
tf.Tensor
``
Labels of your current input. The shape must be [batch_size, n_classes]. If your
labels are not one-hot encoded, you can use ``tf.one_hot`` to convert them first
before giving them to this function.
dtype : dtype
dtype :
``tf.
dtype
``
The dtype that weights will have. It should be float. Best is to provide
logits.dtype as input.
Returns
-------
tf.Tensor
``
tf.Tensor
``
Computed weights that will cancel your dataset imbalance per batch.
Examples
...
...
@@ -100,16 +100,16 @@ def balanced_sigmoid_cross_entropy_loss_weights(labels, dtype="float32"):
Parameters
----------
labels : tf.Tensor
labels :
``
tf.Tensor
``
Labels of your current input. The shape must be [batch_size] and values must be
either 0 or 1.
dtype : dtype
dtype :
``tf.
dtype
``
The dtype that weights will have. It should be float. Best is to provide
logits.dtype as input.
Returns
-------
tf.Tensor
``
tf.Tensor
``
Computed weights that will cancel your dataset imbalance per batch.
Examples
...
...
doc/conf.py
View file @
88eea1d2
...
...
@@ -30,7 +30,7 @@ extensions = [
]
# Be picky about warnings
nitpicky
=
Fals
e
nitpicky
=
Tru
e
# Ignores stuff we can't easily resolve on other project's sphinx manuals
nitpick_ignore
=
[]
...
...
doc/py_api.rst
View file @
88eea1d2
...
...
@@ -86,6 +86,7 @@ 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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment