-
Notifications
You must be signed in to change notification settings - Fork 49
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
[RTR] fix: parameter objective need parameters decision variables in any scenario right ? #930
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #930 +/- ##
==========================================
+ Coverage 77.62% 77.75% +0.12%
==========================================
Files 156 156
Lines 18035 18040 +5
==========================================
+ Hits 14000 14027 +27
+ Misses 4035 4013 -22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 4 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @Ipuch)
bioptim/optimization/parameters.py
line 304 at r2 (raw file):
def unscaled(self): """ This method allows to intercept the scaled item and return the current node_index
Add a comment:
The return parameters is actually the scaled version of it. But for internal reasons, it is expected. This can be confusing for the user who expects an unscaled version though. Therefore, .unscaled should only be call by the programmer who knows what there are doing
bioptim/examples/getting_started/example_parameter_scaling.py
line 183 at r2 (raw file):
g_scaling = VariableScaling("gravity_xyz", np.array([1, 1, 10])) # Does not converge to the right place # "Optimal parameters unscaled: {'gravity_xyz': array([ 0. , 5.00000002, -4.9999999 ])}" # "Optimal parameters scaled: {'gravity_xyz': array([ 0. , 5.00000002, -0.49999999])}"
remove this
bioptim/examples/getting_started/example_parameter_scaling.py
line 213 at r2 (raw file):
dynamics = Dynamics( DynamicsFcn.TORQUE_DRIVEN, # state_continuity_weight=100,
Reinstate
bioptim/interfaces/interface_utils.py
line 388 at r2 (raw file):
p = PenaltyHelpers.parameters( penalty, penalty_idx, lambda p_idx, n_idx, sn_idx: _get_p(ocp, p_idx, n_idx, sn_idx, scaled) )
test this
I've built an example on top of your example @EveCharbie. The Idea is to have an objective with the parameter in it to see it evolve through the iterations of IPOPT, to see if the sol output is the same as the one of IPOPT.
While I had only one objective, the objective was not taken into account. I manage to do a quick fix, with no ideas of the consequences. Some choices may have some rational and need to be discussed in the next PR Review @pariterre
@p-shg, you can build on top of this PR to see through ipopt how the scaling affect the parameter.
On top of :
This change is