Closed yonatank93 closed 2 years ago
@yonatank93 thank for the PR! We may not want to touch the OptimizingParameters
class. Can you please enable Allow edits from maintainers
for me to make some adjustments?
@mjwen I enabled Allow edits from maintainers
. Let me know if this is not working.
The functionality to deal with parameter transformation has all been moved to the Model
class, leaving OptimizingParams
free. Expect the below behaviors:
model.echo_opt_params()
will always show the transformed params
A new parameter params_space
added model.echo_model_params(params_space=...)
. A value of original
will show params in the untransformed space (this is the default behavior), and a value of transformed
will show it in the transformed space.
@yonatank93 Can you test this out and let me know whether this solves your problem?
In OptimizingParams().echo_opt_params()
, would it be useful to add a line in the heading "Parameters in transformed
space.", like in model.echo_model_params()
? Or to the least, we should mention in the documentation for this method that the printed values are in the transformed space.
Agreed! It's useful to let the user know that it's in the transformed space. Added.
Also, it would be helpful to add a tutorial example to demonstrate this. Can you convert your Jupyter notebook to an example as those listed here? Probably take a look at example_kim_SW_Si.py. The docstrings in the examples follow the sphinx-gallery syntax.
Sure, I will do it later today. In the example, we want to show:
Thanks!
We may not want to show how to construct different parameter transformation in this tutorial. But can say that a user can do it easily by subclassing the ParameterTransform
class.
It might be difficult/lengthy to compare the results. So, probably not do it at this stage. We may need longer docs/tutorials once all the UQ stuff is fleshed out. Then, we can do it in a more thorough way.
I will merge and close this. Feel free to open a new PR for the tutorial.
List of changes:
kliff.model.Models().model_params
as an attribute that store the parameter values in the original parameterization.kliff.model.OptimizingParameters()
, e.g., the transform function inget_opt_params
and the inverse transform inupdate_opt_params
methods. This also requires the parameter transfomation class to be passed in toOptimizingParameters
.