Skip to content

Conversation

@jarednielsen
Copy link

@jarednielsen jarednielsen commented May 21, 2020

The function signature for tf.nn.dropout in TF1 is:

tf.nn.dropout(
    x,
    keep_prob=None,
    noise_shape=None,
    seed=None,
    name=None,
    rate=None
)

while TF2 has:

tf.nn.dropout(
    x, rate, noise_shape=None, seed=None, name=None
)

Using the rate keyword argument is compatible with both, and less confusing.

This is done in the ALBERT repo: https://github.com/google-research/albert/blob/c21d8a3616a4b156d21e795698ad52743ccd8b73/modeling.py#L412-L427

@jarednielsen jarednielsen changed the title Fix dropout layer. Fix deprecated keyword argument in dropout layer. May 21, 2020
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

Successfully merging this pull request may close these issues.

1 participant