electra
electra copied to clipboard
Fix deprecated keyword argument in dropout layer.
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