yuvalpinter/Mimick

params in MomentumSGDTrainer

Closed this issue · 4 comments

Hi I was trying out your demo when I run into error at line 166, Mimick/mimick/model.py
trainer = dy.MomentumSGDTrainer(model.model, options.learning_rate, 0.9, 0.1)

The error message shows that MomentumSGDTrainer takes 3 parameters, as in
MomentumSGDTrainer(ParameterCollection &m, real learning_rate = 0.01, real mom = 0.9)

wondering is there a version conflict? But I installed the v2.0 dynet, following your README.

So what is this last parameter 0.1? Do I just simply delete it?

Thanks in advance!

Huh, interesting.
The version of DyNet I work with features an extra edecay parameter specifying learning rate decay. It seems DyNet 2.0 supports it (at least there's no error from interactive mode), and it's present in the DyNet 1.0 handbook (page 43). Since it doesn't appear in the online docs I'm not sure what its omission would do, but it would be interesting to try...

Possibly related: clab/dynet#138 @neubig

There has recently been a change in the training interface to simplify things:
clab/dynet#695

I'd suggest upgrading to the most recent version, but if you'd prefer not to, the DyNet 2.0 version should still work as well:
https://github.com/clab/dynet/releases/tag/v2.0

Thanks Graham! I'll leave this issue open until we upgrade to the latest DyNet release.

The code is now updated to DyNet 2.0!