Reputation: 18545
If I am training on a GRU model, is there a way I can output the learnt parameters so that when I train next time with more data, I can initialize with those learnt parameters as a starting point?
Upvotes: 1
Views: 8603
Reputation: 40516
In case of saving the whole model:
weights = model.get_weights() # Getting params
model.set_weights(weights) # Setting params
In case of saving single layer: You need to find the index of a layer you want to save (let's say that it is i
), then:
weights = model.layers[i].get_weights() # Getting params
model.layers[i].set_weights(weights) # Setting params
Upvotes: 5