Skip to content

Error for Momentum optimizer #3

@ioana-blue

Description

@ioana-blue

I'm getting an error when I use the momentum optimizer:
TypeError: __init__() missing 1 required positional argument: 'momentum'

Initially I thought was some TF API breakage, but I think the culprit is in this line:
https://github.com/CoderPat/structured-neural-summarization/blob/master/train_and_eval.py#L516

def optimizer(lr): return optimizer_class(lr) # **optimizer_params)

For momentum, the constructor expects more parameters, so I'm guessing the following fixes it:
def optimizer(lr): return optimizer_class(lr, **kwargs)
and the kwargs are picked from the above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions