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

loss can't down #6

Open
JiaShengLiu111 opened this issue Mar 13, 2019 · 2 comments
Open

loss can't down #6

JiaShengLiu111 opened this issue Mar 13, 2019 · 2 comments

Comments

@JiaShengLiu111
Copy link

JiaShengLiu111 commented Mar 13, 2019

Thank for your share? I have a question is as follows:
The loss function cannot be reduced and all samples are predicted to be a certain category

I am looking forward for your answer, thank you very much!

@JiaShengLiu111
Copy link
Author

Thank you any way! I already know where I am wrong. In your code, "tf.layers.batch_normalization" have been used, we should define the optimizer as follows:
update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS)
train_op = optimizer.minimize(loss)
train_op = tf.group([train_op, update_ops])
Reference:https://tensorflow.google.cn/api_docs/python/tf/layers/batch_normalization

@NowJzy
Copy link

NowJzy commented Jan 23, 2024

Thank you any way! I already know where I am wrong. In your code, "tf.layers.batch_normalization" have been used, we should define the optimizer as follows: update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS) train_op = optimizer.minimize(loss) train_op = tf.group([train_op, update_ops]) Reference:https://tensorflow.google.cn/api_docs/python/tf/layers/batch_normalization

So how to change the source code?

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