Skip to content
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

Add link for Xavier initializer paper and update example for zero_faction function #9426

Merged
merged 3 commits into from May 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 4 additions & 6 deletions tensorflow/contrib/layers/python/layers/initializers.py
Expand Up @@ -34,9 +34,9 @@ def xavier_initializer(uniform=True, seed=None, dtype=dtypes.float32):
This function implements the weight initialization from:

Xavier Glorot and Yoshua Bengio (2010):
Understanding the difficulty of training deep feedforward neural
[Understanding the difficulty of training deep feedforward neural
networks. International conference on artificial intelligence and
statistics.
statistics.](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.207.2059&rep=rep1&type=pdf)

This initializer is designed to keep the scale of the gradients roughly the
same in all layers. In uniform distribution this ends up being the range:
Expand All @@ -46,8 +46,7 @@ def xavier_initializer(uniform=True, seed=None, dtype=dtypes.float32):
Args:
uniform: Whether to use uniform or normal distributed random initialization.
seed: A Python integer. Used to create random seeds. See
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
@{set_random_seed} for behavior.
dtype: The data type. Only floating point types are supported.

Returns:
Expand Down Expand Up @@ -97,8 +96,7 @@ def variance_scaling_initializer(factor=2.0, mode='FAN_IN', uniform=False,
mode: String. 'FAN_IN', 'FAN_OUT', 'FAN_AVG'.
uniform: Whether to use uniform or normal distributed random initialization.
seed: A Python integer. Used to create random seeds. See
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
@{set_random_seed} for behavior.
dtype: The data type. Only floating point types are supported.

Returns:
Expand Down
5 changes: 2 additions & 3 deletions tensorflow/python/ops/nn_impl.py
Expand Up @@ -301,9 +301,8 @@ def zero_fraction(value, name=None):
This is useful in summaries to measure and report sparsity. For example,

```python
z = tf.Relu(...)
summ = tf.contrib.deprecated.scalar_summary('sparsity',
tf.nn.zero_fraction(z))
z = tf.nn.relu(...)
summ = tf.summary.scalar('sparsity', tf.nn.zero_fraction(z))
```

Args:
Expand Down