librascal icon indicating copy to clipboard operation
librascal copied to clipboard

Misleading name and documentation for `Spherical(In|Co)variants.update_hyperparameters()`

Open max-veit opened this issue 3 years ago • 4 comments

Judging from the name and documentation of this function -- e.g. here: https://github.com/cosmo-epfl/librascal/blob/43a410c6d7cea3d17852e9c8c6fe332ec46f13df/bindings/rascal/representations/spherical_expansion.py#L236-L240 -- I would expect this function to also update the parameters of the underlying C++ object, so that further calls to the transform() method use the representation with the updated parameters. However, the code makes it clear that this is not the case, and that this is simply a parameter validation method for internal use only.

Fix: Rename the function and documentation to reflect this fact. Instead of allowing (or promising to allow) updating of hypers on the fly, just encourage the user to make a new representation.

max-veit avatar May 10 '21 13:05 max-veit

Suggestion for rename of the function: _shallow_update(self, **hypers) The private makes the user aware that it should be used with care and the hypers can be induced from the input arguments.

agoscinski avatar May 10 '21 13:05 agoscinski

We should use the hacky solution for a new update_hyperparameters() function

agoscinski avatar Nov 11 '21 16:11 agoscinski

Sorry, what hacky solution?

max-veit avatar Nov 25 '21 17:11 max-veit

Ah sorry, I think I commented before finishing the whole comment. @cbenmahm had a solution, by basically creating a new Spherical(In|Co)variants object. "hacky" because we don't really update parameters, but ditch the old object. Let me finish #394 and I go back on this issue

agoscinski avatar Nov 30 '21 08:11 agoscinski