Commit fbbd435a authored by Yuxin Wu's avatar Yuxin Wu

Use tf.layers.dropout. Add gitter badge.

parent 5c9174db
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
A neural net training interface based on TensorFlow. A neural net training interface based on TensorFlow.
[![Build Status](https://travis-ci.org/ppwwyyxx/tensorpack.svg?branch=master)](https://travis-ci.org/ppwwyyxx/tensorpack) [![Build Status](https://travis-ci.org/ppwwyyxx/tensorpack.svg?branch=master)](https://travis-ci.org/ppwwyyxx/tensorpack)
[![badge](https://readthedocs.org/projects/tensorpack/badge/?version=latest)](http://tensorpack.readthedocs.io/en/latest/index.html) [![ReadTheDoc](https://readthedocs.org/projects/tensorpack/badge/?version=latest)](http://tensorpack.readthedocs.io/en/latest/index.html)
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/tensorpack/users)
See some [examples](examples) to learn about the framework: See some [examples](examples) to learn about the framework:
......
...@@ -95,5 +95,5 @@ def Dropout(x, keep_prob=0.5, is_training=None, noise_shape=None): ...@@ -95,5 +95,5 @@ def Dropout(x, keep_prob=0.5, is_training=None, noise_shape=None):
""" """
if is_training is None: if is_training is None:
is_training = get_current_tower_context().is_training is_training = get_current_tower_context().is_training
keep_prob = tf.constant(keep_prob if is_training else 1.0) return tf.layers.dropout(
return tf.nn.dropout(x, keep_prob, noise_shape=noise_shape) x, rate=1 - keep_prob, noise_shape=noise_shape, training=is_training)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment