Toggle variable learning on and off during learning

I want to either start or stop learning a variable while learning. Although the constructor Variable

has a parameter trainable

, this parameter cannot be changed after construction.

To achieve this effect, my current solution is to save the model at the point where I want to change the trainable state of the variable, restore the network with the variables set to the desired training state, and reload the weight.

Is there a less cumbersome way to change the effect of training on a variable programmatically?

+3


source to share





All Articles