Evaluation Fitness vs. First Generation Fitness

SCONE is a software tool for predictive simulations of biomechanical movement. It uses OpenSim for modeling and simulation, and performs optimization using various control strategies, including feed-forward control, proprioceptic feedback control, and bal
POST REPLY
User avatar
Eric Hu
Posts: 38
Joined: Tue Oct 03, 2023 1:56 pm

Evaluation Fitness vs. First Generation Fitness

Post by Eric Hu » Wed Oct 23, 2024 7:16 pm

Hi Dr. Geijtenbeek,

I hope you are doing well and thank you for answering my previous inquiries. I was wondering if you would have any advice to begin the optimizations with the fitness that appears in the evaluation results. The first few generations of my optimization are usually a huge factor larger than the fitness shown when I evaluate the results. My goal is to improve my fitness even further than what I have by replacing the current parameters of my optimizations with those from the last optimization and wishing to start at the final fitness of the last optimization as well.

Thank you so much,
Eric

User avatar
Thomas Geijtenbeek
Posts: 461
Joined: Wed Mar 12, 2014 8:08 am

Re: Evaluation Fitness vs. First Generation Fitness

Post by Thomas Geijtenbeek » Wed Oct 23, 2024 11:54 pm

You can achieve this by lowering the initial standard deviation of the parameters. This will cause the optimizer to start searching closer to the initial parameter mean.

If you're using a .par file to initialize your parameters, you can use the std_factor parameter to accomplish this. See:

https://scone.software/doku.php?id=ref: ... t_settings

You can check the Parameters window (via Windows -> Parameters) to see the initial STDEV for each of the parameters.

Also (just in case), make sure you are not accidentally maximizing your objective function.

User avatar
Eric Hu
Posts: 38
Joined: Tue Oct 03, 2023 1:56 pm

Re: Evaluation Fitness vs. First Generation Fitness

Post by Eric Hu » Sat Oct 26, 2024 1:13 pm

Dr. Geijtenbeek,

Thank you for your response. I am now wondering if it would be best to also update the standard deviations as well as the means after every optimization for my purpose. Ultimately, I would like to let my simulations search for more possible solutions after it begins with it's initial fitness. To my understanding, decreasing the standard deviation would limit the search space in the regions I provide. Could you clarify if this is the case and what advice would you give for my purpose?

Best,
Eric

User avatar
Thomas Geijtenbeek
Posts: 461
Joined: Wed Mar 12, 2014 8:08 am

Re: Evaluation Fitness vs. First Generation Fitness

Post by Thomas Geijtenbeek » Sun Oct 27, 2024 5:57 am

Low initial standard deviations do not necessarily limit the search space to specific regions, but they do make the search path more continuous. This can either be a good thing or a bad thing.

Are you using the init statement with a .par file like I suggested in the previous response? If so, it should be straightforward to try out different standard deviations and find out what works best for your specific use case.

Please also note that you can right-click on any .par file to copy it to the scenario folder, allowing you to easily reuse any .par file for subsequent optimizations.

User avatar
Eric Hu
Posts: 38
Joined: Tue Oct 03, 2023 1:56 pm

Re: Evaluation Fitness vs. First Generation Fitness

Post by Eric Hu » Sun Oct 27, 2024 11:35 pm

Dr. Geijtenbeek,

I am not using a .par file to initialize my parameters. Though, now knowing this, I will start doing this from now on. In order to begin doing this, would I have to change my controller at all or would the .par file be replacing my controller? Do I add this par file in the main SCONE optimizer file or within my controller? I am currently manually initializing all of my parameters within the controller.

Best,
Eric

User avatar
Thomas Geijtenbeek
Posts: 461
Joined: Wed Mar 12, 2014 8:08 am

Re: Evaluation Fitness vs. First Generation Fitness

Post by Thomas Geijtenbeek » Mon Oct 28, 2024 2:45 am

No need to change the Controller, the init statement will simply replace the initial means and standard deviations with values in the .par file.

For an example, see the H0918 gait scenario in the Examples folders, or check the documentation:

https://scone.software/doku.php?id=doc:init

User avatar
Eric Hu
Posts: 38
Joined: Tue Oct 03, 2023 1:56 pm

Re: Evaluation Fitness vs. First Generation Fitness

Post by Eric Hu » Mon Oct 28, 2024 4:29 pm

Dr. Geijtenbeek,

Sounds good. I will definitely try this method. Could you explain the difference of initializing the parameters with the controller and the .par file? To my current understanding, the optimization would start with the parameters set in the par file, but then use the optimizable parameters in the controller to push the optimizer forward. Would this be correct or am I no where close? :lol:

User avatar
Thomas Geijtenbeek
Posts: 461
Joined: Wed Mar 12, 2014 8:08 am

Re: Evaluation Fitness vs. First Generation Fitness

Post by Thomas Geijtenbeek » Tue Oct 29, 2024 1:49 am

Initializing with a .par file simply sets the initial mean and standard deviation of all the corresponding parameters in the scenario.

Please open the Parameters Window (Windows -> Parameters) and try out both methods to see the difference.

POST REPLY