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

Add 'negate' property to MocoOutputGoal. #637

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

chrisdembia
Copy link
Member

@chrisdembia chrisdembia commented May 26, 2020

Fixes issue #606

Brief summary of changes

Add a property negate to MocoOutputGoal.

@aaronsfox does this work for you? Would you want this ability to be on the base MocoGoal?

CHANGELOG.md (choose one)

  • updated

This change is Reviewable

@aaronsfox
Copy link

@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?

@chrisdembia
Copy link
Member Author

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.

@nickbianco
Copy link
Member

@aaronsfox @chrisdembia any reason why this is still in draft? Looks like we could review and merge.

@chrisdembia
Copy link
Member Author

Yeah; I'm not sure this is the correct approach. Perhaps the property should be on the base MocoGoal, or perhaps we should just allow negative weights.

@aaronsfox
Copy link

@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.

Copy link
Member

@nickbianco nickbianco left a 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

@aaronsfox
Copy link

@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)

@aaronsfox
Copy link

@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

@chrisdembia
Copy link
Member Author

Thanks for the update.

I agree with you and nick about adding a ‘maximize’ (or ‘minimize’) property.

@aaronsfox
Copy link

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.

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.

3 participants