Yes, the code looks generally alright.
I don’t quite understand the list(map(lambda ...)
usage to create the parameters and think just using model.parameters()
or list(model.parameters())
should do the same.
In any case, you would still need to fix the optmizer.step()
calls, since now you are creating one optimizer
, but are trying to call the step()
method on two different optimizers.