update state in dlnetworks

9 visualizaciones (últimos 30 días)
sepid_kl
sepid_kl el 13 de Dic. de 2020
Comentada: Tao el 23 de Feb. de 2023
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?

Respuestas (1)

Katja Mogalle
Katja Mogalle el 1 de Jul. de 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
  1 comentario
Tao
Tao el 23 de Feb. de 2023
I also have a question. Refer to GAN (https://ww2.mathworks.cn/help/deeplearning/ug/train-generative-adversarial-network.html?s_tid=srchtitle_network%20state_8), the netG also has batchNormlization Layers. But the code only output netD.State and does not update netG.State.
So, if the network used in ModelGradient function is "forwarded" more than 1 time. Which "forward" function should output "state"?

Iniciar sesión para comentar.

Categorías

Más información sobre Image Data Workflows en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by