Skip to content

Commit

Permalink
Fix for invalid dropout values
Browse files Browse the repository at this point in the history
  • Loading branch information
fchollet committed Apr 12, 2016
1 parent 26714bc commit d50f469
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions keras/layers/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ class Dropout(Layer):
- [Dropout: A Simple Way to Prevent Neural Networks from Overfitting](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)
'''
def __init__(self, p, **kwargs):
self.supports_masking = True
self.uses_learning_phase = True
self.p = p
if 0. < self.p < 1.:
self.uses_learning_phase = True
self.supports_masking = True
super(Dropout, self).__init__(**kwargs)

def call(self, x, mask=None):
Expand Down

0 comments on commit d50f469

Please sign in to comment.