-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add 'negate' property to MocoOutputGoal. #637
base: master
Are you sure you want to change the base?
Conversation
@chrisdembia I think the ability to include this on any MocoGoal would be beneficial. As noted I can at least see it being useful in my context for the output and joint reaction goals. Does simply negating or adding a negative weight to do this potentially cause any issues with a combined objective function having both positive and negative costs, or even the overall cost function output being negative? |
I cannot think of any issues right now. It's completely fine for the overall cost function output to be negative. |
@aaronsfox @chrisdembia any reason why this is still in draft? Looks like we could review and merge. |
Yeah; I'm not sure this is the correct approach. Perhaps the property should be on the base |
@chrisdembia @nickbianco I still haven't got to the test of using negative weights in a problem I'm running. Was working on this the other day but had another issue come up that needed fixing before I could test further. I think it would be good to have a sort of 'switch' on the base MocoGoal that you could trigger to 'maximise' any goal - I think it can be relevant in a number of more performance focused tasks (e.g. maximise a muscles force output or contraction velocity). If negative weights work, I still think it would help to have a separate property that could trigger making the weight negative, just so that minimised vs. maximised goals could be more easily defined. |
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.
Oh, I looked at this too quickly, I didn't realize these changes weren't already on MocoGoal. I think I'd prefer having a property and disallowing negative weights.
Reviewable status: 0 of 3 files reviewed, all discussions resolved
@nickbianco @chrisdembia I'd agree with Nick that having a property on the base goal would be the most intuitive approach vs. allowing negative weights. I also wonder whether labelling this property as something like 'maximise' rather than 'negate' would make it easier to find/understand (i.e. my initial query was how do I maximise an output) |
@chrisdembia @nickbianco a quick update on this - setting a negative weight in a joint reaction goal did what it was supposed to, in that I was able to 'maximise' the compressive component of the force. It is a little counter-intuitive watching the objective value become a 'bigger' negative value though as the optimiser worked |
Thanks for the update. I agree with you and nick about adding a ‘maximize’ (or ‘minimize’) property. |
I will mention that maximising things that don't have distinct capped limits could induce problems if weighting and other factors isn't carefully considered. In my example, the marker end point goals seemed to suffer as a result of trying to make the shoulder compressive forces greater. Similarly the control cost function rose substantially as muscles were maximally activated to produce the compressive force. This seems distinctly different to something like minimising a marker end point goal that has a definitive minimum of zero distance from its goal. |
Fixes issue #606
Brief summary of changes
Add a property
negate
toMocoOutputGoal
.@aaronsfox does this work for you? Would you want this ability to be on the base
MocoGoal
?CHANGELOG.md (choose one)
This change is