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

The output of K.dropout is not as expected! #5539

Closed
Imorton-zd opened this issue Feb 27, 2017 · 2 comments
Closed

The output of K.dropout is not as expected! #5539

Imorton-zd opened this issue Feb 27, 2017 · 2 comments

Comments

@Imorton-zd
Copy link

Imorton-zd commented Feb 27, 2017

For example:

x = numpy.array[[1,2,3],[4,5,6]]
x = K.variable(value = x, dtype = 'float64')
out = K.dropout(x, 0.4, seed=1334)
K.eval(out)

The results:
array([1.6666666, 3.3333332, 4.9999998], [0. , 8.33333 , 0. ])

But, in my opinion, the dropout operator only sets entries in x to zero at random, the results should be like: array([1, 2, 3], [0. , 5 , 0. ])
why are other elements also modified?
If I want to implement the function like my description, which method should I use? Any opinions or suggestions would be appreciated!

@unrealwill
Copy link

Hello,

Because Keras use inverse scaling for dropout.

See #3305
and #5357

for more information.

@Imorton-zd
Copy link
Author

Thanks for your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants