Just wondering if someone can provide a bit of advice on proper usage of a scheduler with an optimizer and SVI.
Here’s a few snippets of relevant code I’ve tried, along with accompanying error messages:
1
AdamArgs = { 'lr': 1e-3 }
optimizer = Adam
scheduler = pyro.optim.ExponentialLR({'optimizer': optimizer, 'optim_args': AdamArgs, 'gamma': 0.996 })
seqVAE = AEModel.SeqVAE(141, 128, 512, 2, 128, 3)
svi = SVI(seqVAE.model, seqVAE.guide, scheduler, loss=Trace_ELBO())
Throws error:
TypeError: <lambda>() got an unexpected keyword argument 'lr'
2
AdamArgs = { 'lr': 1e-3 }
optimizer = Adam(AdamArgs)
scheduler = pyro.optim.ExponentialLR({'optimizer': optimizer, 'optim_args': AdamArgs, 'gamma': 0.996 })
seqVAE = AEModel.SeqVAE(141, 128, 512, 2, 128, 3)
svi = SVI(seqVAE.model, seqVAE.guide, scheduler, loss=Trace_ELBO())
throws error:
TypeError: step() got an unexpected keyword argument 'lr'
What’s the proper usage here? I thought, in the case of my first example, that I was following the Pyro documentation…
Thanks in advance.
edit:
I should say that if I don’t use a scheduler and instead just the optimizer, everything runs and trains correctly without any errors, hence me not providing additional code.