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
Feature request: re-add activation histograms #118
Comments
I can try to solve this |
Hey @bersbersbers as far as I know you can visualize histograms in |
@Cheril311 please see tensorflow/tensorflow#42027 (comment). Keras writes weight histograms, but no activation histograms. |
You seem to be right @bersbersbers , for now I have changed the documentation as I do know how to compute activation histograms but I am unaware on how to write them as tensorboard images |
I would think activation histograms can be written the same way as the weight histograms, at least in a first iteration. After all, both should have the exact same dimensions. |
Yup I agree with that but there is some other process done in the function _log_weight_as_image in callbacks.py and I am not sure how to do the same for activations, if you can help me maybe we can submit a pr |
To my understanding, activations (for one sample) and weights have the same shape, so you can do exactly the same thing as here: Since you mentioned in #118 that you know how to compute activation histograms (although I have yet to find a good solution myself, compare https://stackoverflow.com/q/60816678, https://gist.github.com/SiLiKhon/3965c967c3283feccc79822e6252b34c, https://stackoverflow.com/q/66779524), this should be straightforward then. Good luck! |
Summary: The tensorboard callback doesn't print activation histograms. The solution is either change the docs or fix this bug. |
This should have been fixed. Please reopen if it is not. |
@haifeng-jin may I ask where I can see the change? Did you update the docs or implement the functionality? I don't see any commit on https://github.com/keras-team/keras/commits/master, and https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/TensorBoard (which has been updated for TB2.8.0) still mentions "Activation histograms". |
@bersbersbers Do you reproduce it in TF-nightly? The commit should be sometime ago. This was from the team member who handled this. |
@haifeng-jin I am getting errors with TensorBoard on # pip install tensorflow
# pip uninstall keras
# pip install keras-nightly
import tensorflow as tf
layer = tf.keras.layers.Input(shape=())
model = tf.keras.Sequential()
model.add(tf.keras.layers.Dense(4, input_shape=(4,)))
model.compile(optimizer="adam", loss="mse")
model.summary()
cb = tf.keras.callbacks.TensorBoard("logs", histogram_freq=1)
model.fit(x=[[1,2,3,4]], y=[[1,2,3,4]], epochs=2, callbacks=[cb])
# tensorboard --logdir logs And then there's weight histograms, but not activation histograms, just like 1.5 years ago. |
This is now a feature request and contributions are welcome |
Thanks. For the record, I had previously missed the fix to the documentation in 2ba6dea / tensorflow/tensorflow#54196, hence my confusion. |
Suggest renaming this issue to "Feature request: re-add activation histograms" |
@LukeWood anyone working on it? I would like to if no one else is. |
Dont think so! |
System information.
TensorFlow version: 2.8.0-rc1
Describe the feature and the current behavior/state.
https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/TensorBoard says:
But I am fairly certain activation histograms are not written, see also tensorflow/tensorflow#39755 and tensorflow/tensorflow#42027.
Solutions:
Will this change the current api? How?
1 will not change the API; 2 will change the docs.
Who will benefit from this feature?
Everyone
The text was updated successfully, but these errors were encountered: