Skip to content

Conversation

@ceriottm
Copy link
Contributor

@ceriottm ceriottm commented May 28, 2021

Utility functions and one-line helper to compute optimal radial basis for a dataset

Rationale and detailed description of the changes:
The optimal radial basis calculation requires a lot of manual steps. This PR creates a handful of clean functions to perform the different steps, as well as a simple wrapper that adds projection matrices to a template dictionary of hyperparameters.

Tasks before review:

  • Add tests, examples, and complete documentation of any added functionality
    • Make sure the autogenerated documentation appears in Sphinx and is
      formatted correctly (ask @max-veit if you need help with this task).
    • Write additional documentation in the Sphinx (not docstrings!) to
      explain the feature and its usage in plain English
    • Make sure the examples run (!) and produce the expected output
  • Run make lint on the project, ensure it passes
    • Run make pretty-cpp and make pretty-python, check that the
      auto-formatting is sensible
    • Review variable names, make sure they're descriptive (ask a friend)
    • Review all TODOs, convert to issues wherever possible
    • Make sure draft, in-progress, and commented-out code is moved to its
      own branch
  • If committing any code in Jupyter/IPython notebooks, install and run nbstripout
  • Merge with master and resolve any conflicts

@ceriottm ceriottm requested review from agoscinski and max-veit May 28, 2021 22:09
Copy link
Contributor

@agoscinski agoscinski left a comment

Choose a reason for hiding this comment

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

Looks already good.

  • needs some simple tests for the new utils function
  • I would just adapt the notebook a bit, especially the last parts are sparse in explanations (also I would like to put my visual example for the radial spectrum density back)

I would just do a commit with these changes, and you can give me a comment on the changes, but you can also do it if you want

I think the example notebook has to be git mv so the changes are tracked, but this can be done in the rebase.

.gitattributes Outdated
*.ipynb filter=nbstripout
*.ipynb diff=ipynb

examples/zundel_i-PI.ipynb filter= diff=
Copy link
Contributor

@agoscinski agoscinski Jun 2, 2021

Choose a reason for hiding this comment

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

This is here because zundel notebook is a notebook where the the output is important and a change in the output should be recorded by git, correct?
Then I would still do it in another PR, since you don't touch the notebook here. Or did you touch the notebook and did not commit it?

Copy link
Contributor

Choose a reason for hiding this comment

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

It actually appears in another PR (#354) where the notebook is changed, so I'd leave it for there.

sigma_grid[:, np.newaxis],
sigma_grid[np.newaxis, :],
)
# S = fractional_matrix_power(S, -0.5)
Copy link
Contributor

Choose a reason for hiding this comment

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

would remove the commented line then and add comment

# Symmetric orthogonalization matrix

@ceriottm
Copy link
Contributor Author

ceriottm commented Jun 2, 2021 via email

@@ -0,0 +1,415 @@
{
Copy link
Contributor

@max-veit max-veit Jun 2, 2021

Choose a reason for hiding this comment

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

Might this be a good notebook to include in the examples page? If so, you can link the file into the docs/source/examples/ directory and then add it here: https://github.com/cosmo-epfl/librascal/blob/4e576ae7b9d3740715ab1910def5e1a15ffd1268/docs/source/examples/examples.rst#L09-L12
Then try compiling the docs locally and see if it produces any errors :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Works! Will push with next commit

Copy link
Contributor

Choose a reason for hiding this comment

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

@ceriottm does it really work? If I compile it locally I don't see the radial optimizations notebook. I find that weird because I could not find zundel_i-PI.ipynb added anywhere else than here, so I am not sure why this is

@ceriottm
Copy link
Contributor Author

ceriottm commented Jun 3, 2021

OK I think I implemented all the changes you guys asked. PLS have a second round if you want to.

@agoscinski
Copy link
Contributor

agoscinski commented Jun 3, 2021

Hello you need to add your new tests to tests/python_binding_test.py by adding a entry

from python_utils_test import TestOptimalRadialBasis

Then you get some test error (reminder ctest -R python to only run python test), I guess it will be simple to fix

@agoscinski
Copy link
Contributor

I am okay with branch. It only needs to be checked if the problem that the notebook is now shown in the docs examples is only a local problem for me.
And would squash commits to one.

@ceriottm
Copy link
Contributor Author

ceriottm commented Jun 3, 2021

I am okay with branch. It only needs to be checked if the problem that the notebook is now shown in the docs examples is only a local problem for me.
And would squash commits to one.

what do you mean the problem with the notebook? it shows correctly in my local documentation

Copy link
Contributor

@agoscinski agoscinski left a comment

Choose a reason for hiding this comment

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

I don't see the notebook it in the examples at all in the doc page, but it seems to be only on my side. So I am okay with the branch, just squash and merge to one commit or rebase in some other way

@ceriottm ceriottm merged commit 6deb5c3 into master Jun 4, 2021
@ceriottm ceriottm deleted the feat/optimal_radial_utils branch June 4, 2021 06:02
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.

5 participants