Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Conversation

@linmx0130
Copy link
Contributor

@winstywang @sxjscience Sorry for my bad code. Thanks for commenting. This version is a revised version.

history = state
history[:] += (grad * grad)
delta = zeros(weight.shape, weight.context)
delta[:] = -self.lr * (grad / sqrt(history + self.float_stable_eps) + self.wd*weight)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we directly use weight[:] += -self.lr * (grad / sqrt(history + self.float_stable_eps) + self.wd*weight) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not tried but it should be correct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I think there should be a blank line after each member function and spaces for * OP.

@linmx0130
Copy link
Contributor Author

Updated.

@piiswrong
Copy link
Contributor

LGTM

piiswrong added a commit that referenced this pull request Mar 9, 2016
add AdaGrad optimizer in python, a revised version
@piiswrong piiswrong merged commit 32375b8 into apache:master Mar 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants