You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am using DJL for developing a Deep Q-Network. For this, I need to have two networks, a policy and a target network. The policy network is always updated with each training iteration and every N iterations, the parameters are copied to the target network. I saw someone doing this using the following code:
protected final void syncNets() {
for (Pair<String, Parameter> params : policy_net.getBlock().getParameters()) {
target_net.getBlock().getParameters().get(params.getKey())
.setArray(params.getValue().getArray().duplicate());
}
target_predictor = target_net.newPredictor(new NoopTranslator());
}
However, when I try to use this it gives an error saying the array has already been set. After analysing the Parameter class better, it looks like once they have been set once they can't be altered by hand. Is there any other way of updating the networks parameters without having to create a new network each time?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I am using DJL for developing a Deep Q-Network. For this, I need to have two networks, a policy and a target network. The policy network is always updated with each training iteration and every N iterations, the parameters are copied to the target network. I saw someone doing this using the following code:
However, when I try to use this it gives an error saying the array has already been set. After analysing the Parameter class better, it looks like once they have been set once they can't be altered by hand. Is there any other way of updating the networks parameters without having to create a new network each time?
Beta Was this translation helpful? Give feedback.
All reactions