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

[WIP] Variable scaling #572

Merged
merged 81 commits into from
Dec 15, 2022
Merged

Conversation

EveCharbie
Copy link
Collaborator

@EveCharbie EveCharbie commented Nov 4, 2022

All Submissions:

  • Have you followed the guidelines in our Contributing document [docs/contribution.md]?
  • Have you checked to ensure there aren't other open [Pull Requests] for the same update/change?
  • Have you opened/linked the issue related to your pull request? issue Auto scaling of optimization variables based on bounds #305
  • Have you used the tag [WIP] for on-going changes, and removed it when the pull request was ready?
  • When ready to merge, have you sent a comment pinging @pariterre in it?

New Feature Submissions:

  1. Does your submission pass the tests (if not please explain why this is intended)?
  2. Did you write a proper documentation (docstrings and ReadMe)
  3. Have you linted your code locally prior to submission (using the command: black . -l120 --exclude "external/*")?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new examples for your core changes, as applicable?
  • Have you written new tests for your core changes, as applicable?

This change is Reviewable



x_scaling = VariableScalingList()
x_scaling.add("q", scaling=[1, 1]) # declare keys in order, so that they are concatenated in the right order
Copy link
Contributor

Choose a reason for hiding this comment

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

do you check if scaling is always positive?

Copy link
Member

Choose a reason for hiding this comment

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

Good point
FYI, next time use the "Reviewable" button (as opposed to "Files changed") so we don't sparse the comments across two methods

@EveCharbie
Copy link
Collaborator Author

I think I still need quite a bit of work on this PR, and now I need to work on other things. So I will take a break from this PR. TODO:
iter and next in OptimizationVariablesContrainer
Update biorbd in env + merge bioptim to see if fatigue works (otherwise pariterre will have a look at it)
Test scaling with a granilarity of round numbers like 1, 10, 100 instead of 85 to see if there is a difference
Raise an error of only some scaling are defined (only 'qdot' for example)
Check CVODES behaviour + probably raise an error if used with scaling
remove all ['unscaled'] with appropriate methods

  • everything in the review

Copy link
Member

@pariterre pariterre left a comment

Choose a reason for hiding this comment

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

Reviewed 33 of 33 files at r5, all commit messages.
Reviewable status: all files reviewed, 26 unresolved discussions (waiting on @EveCharbie and @mickaelbegon)

@codecov
Copy link

codecov bot commented Dec 15, 2022

Codecov Report

Base: 81.60% // Head: 81.47% // Decreases project coverage by -0.12% ⚠️

Coverage data is based on head (fd9a1fb) compared to base (dffe9eb).
Patch coverage: 87.96% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #572      +/-   ##
==========================================
- Coverage   81.60%   81.47%   -0.13%     
==========================================
  Files         104      105       +1     
  Lines       11367    11703     +336     
==========================================
+ Hits         9276     9535     +259     
- Misses       2091     2168      +77     
Impacted Files Coverage Δ
bioptim/dynamics/ode_solver.py 88.69% <ø> (ø)
...ioptim/examples/getting_started/custom_dynamics.py 88.63% <ø> (-0.26%) ⬇️
...ptim/examples/getting_started/custom_parameters.py 76.92% <ø> (-0.44%) ⬇️
...getting_started/example_continuity_as_objective.py 46.75% <0.00%> (ø)
bioptim/examples/getting_started/pendulum.py 70.37% <ø> (-1.06%) ⬇️
...es/muscle_driven_ocp/muscle_excitations_tracker.py 73.63% <0.00%> (ø)
...mmetrical_torque_driven_ocp/symmetry_by_mapping.py 87.50% <ø> (-0.38%) ⬇️
...examples/torque_driven_ocp/example_soft_contact.py 82.81% <ø> (+1.93%) ⬆️
...amples/torque_driven_ocp/multi_model_by_mapping.py 83.33% <ø> (-0.28%) ⬇️
bioptim/gui/check_conditioning.py 85.59% <63.63%> (ø)
... and 29 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pariterre pariterre merged commit fdd2b70 into pyomeca:master Dec 15, 2022
@Ipuch
Copy link
Collaborator

Ipuch commented Dec 16, 2022

🎉

@EveCharbie EveCharbie deleted the variables_scaling branch May 30, 2023 07:15
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