0

In tensorflow2 ,we know that in backpropagation progress, we need weights and activations to calcute partial derivatives,I can find weights in stored in the model tf.keras.Model, but the activation values (intermediate values used for the calcualtions of back-propagation), where are they stored?.

meallhour
  • 13,921
  • 21
  • 60
  • 117
灵翼俠
  • 11
  • 2
  • Does this answer your question? [Get Gradients with Keras Tensorflow 2.0](https://stackoverflow.com/questions/57759635/get-gradients-with-keras-tensorflow-2-0) – Mohamed abdelmagid Sep 21 '21 at 14:29

1 Answers1

0

The activations are under tf.keras.activations check the API docs

  • I suppose I do not clarify it clearly,I means that where do the activations result calculated in forward progress saved in tensorflow? – 灵翼俠 Sep 21 '21 at 14:01
  • As I see it,in backpropagation progress,weight and activations result calculated in forward progress are intermediate factor to calculate partial of every weights,so they should be saved somewhere。 – 灵翼俠 Sep 21 '21 at 14:04
  • You can check the guide [here](https://www.tensorflow.org/guide/autodiff#intermediate_results) this part addresses the computation of intermediate gradients within Tensorflow, and If you are asking about accessing them during model training, then you will probably need to check on callbacks. – Mohamed abdelmagid Sep 21 '21 at 14:26
  • Check this [question](https://stackoverflow.com/questions/57759635/get-gradients-with-keras-tensorflow-2-0) I believe this is what you want. – Mohamed abdelmagid Sep 21 '21 at 14:28
  • You can also check [here](https://stackoverflow.com/questions/58350527/how-to-get-activation-values-from-tensor-for-keras-model) – Mohamed abdelmagid Sep 21 '21 at 15:09