-
Notifications
You must be signed in to change notification settings - Fork 345
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
modify dropoutnet in case of batch size mismatch #505
Conversation
� Conflicts: � easy_rec/version.py
� Conflicts: � docs/source/train.md
# Conflicts: # docs/source/component/custom_loss.md # easy_rec/python/loss/jrc_loss.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Draw some random uniform numbers, then check them with keep_rate. Maybe it's simpler in this way to get bernoulli numbers?
mask = tf.random.uniform(shape=(20,)) < keep_rate
mask = tf.cast(mask, tf.int32)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah! both do almost the same thing~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested on higher version of tensorflow(2.18), below statement is not working, giving some error messages, maybe due to tf and numpy compatibility issue:
import tensorflow as tf
tf = tf.compat.v1
keep_rate = 0.2
dist = tf.distributions.Bernoulli(probs=keep_rate)
dist.sample(sample_shape=(5,))
error msg:
AttributeError: module 'numpy.core.multiarray' has no attribute 'integer'
No description provided.