MATLAB Answers

update state in dlnetworks

4 views (last 30 days)
sepid_kl
sepid_kl on 13 Dec 2020
Answered: Katja Mogalle on 1 Jul 2021
hi
in Train Network Using Custom Training Loop , in training part, state was updated(dlnet.State = state).
i want to train a siamese network, and i saw in matlab example for siamese net , state dosn't update.
so my question is that why we dont update state in second network?

Answers (1)

Katja Mogalle
Katja Mogalle on 1 Jul 2021
Great question, and good observation. I think it would be best practise to indeed also update the state for the siamese network.
However, the specific network used in the documentation example doesn't contain any layers with state. So the whole network doesn't have any state that needs any updating.
If the network had, for example, batchNormalization layers, then the state would need to be update as shown here: https://www.mathworks.com/help/deeplearning/ug/update-batch-normalization-statistics-in-custom-training-loop.html

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by