Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update adlala.py #7

Merged
merged 0 commits into from
May 1, 2020
Merged

Update adlala.py #7

merged 0 commits into from
May 1, 2020

Conversation

yuanqing-wang
Copy link
Member

No description provided.

Copy link
Member

@maxentile maxentile left a comment

Choose a reason for hiding this comment

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

a few initial comments, more thorough review coming soon!

pinot/inference/adlala.py Outdated Show resolved Hide resolved
pinot/inference/adlala.py Outdated Show resolved Hide resolved
pinot/inference/adlala.py Show resolved Hide resolved
Copy link
Member

@jchodera jchodera left a comment

Choose a reason for hiding this comment

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

This looks great! Thanks for the excellent documentation!

Perform the steps in the following order:

```
A^1_(h/2)
Copy link
Member

Choose a reason for hiding this comment

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

You might note the initialization step(s) as well, since this is a formulation in which the weights and momenta are half a step out of sync during each step.

# E_(h/2) step: \xi := \xi + 0.5 * h * \epsilon * (p^T p - N * \tao)
state['xi'].add_(
0.5 * group['h'] * group['epsilon'] *\
(torch.sum(torch.pow(state['p'].flatten(), 2)) - state['p'].shape[0] * group['tau']))
Copy link
Member

Choose a reason for hiding this comment

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

point of uncertainty: N here should be "number of parameters". is state['p'].shape[0] always equal to the number of parameters? may be safer to do np.prod(state['p'].shape) instead, in case state['p'] is not flat

Copy link
Member Author

Choose a reason for hiding this comment

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

p might not always be flat. in this case I'll switch to torch.prod

asked the authors here for further clarification

TiffanyVlaar/ThermodynamicParameterizationOfNNs#1

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed in 7c7e09e

@yuanqing-wang yuanqing-wang merged this pull request into review-adlala May 1, 2020
@maxentile
Copy link
Member

Sorry, wasn't quite done yet! Would still like to make sure there's a test or two here. My changes so far just refactor the substeps and their order in a way that makes them more amenable to review and later generalization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants