-
-
Notifications
You must be signed in to change notification settings - Fork 603
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
Flux docs missing withgradient() call for multi-objective loss functions #2325
Comments
I'm not sure what we should add to the documentation. |
There currently isn't any mention of how to look at multiple outputs using |
I guess where I'm confused is why this feature request is about multi-objective losses? Mostly because this: loss, grads = withgradient(model) do m
a = loss_a(m, x)
b = loss_b(m, x)
c = a + b
return c
end Is still training with a "multi-objective loss" from my perspective. What the recent |
@ToucheSir, the functionality you included in your previous post is well-documented. That code will calculate the gradients and the total loss of the combined individual loss terms. I am interested in using trio, grads = withgradient(model) do m
a = loss_a(m, x)
b = loss_b(m, x)
(; c=a+b, a, b)
end you would have to call @mcabbott, yes even something small like that would really help! Just something to make it more explicit that this functionality exists. |
Ok, so in that case I agree with Carlo that the documentation should not mention multi-objective losses specifically, but rather focus on getting auxiliary information out and perhaps provide individual loss terms as an example. |
After talking with @mcabbott on slack, we determined that Flux is missing documentation for a
withgradient()
call for multi-objective optimization. @mcabbott provided the below codeDocumentation currently exists on Zygote.jl but not on Flux docs. The existing Zygote docs can be found here. As a suggestion, I think it might be appropriate to add these docs to the Loss Functions section and maybe add a new header that shows how to take gradients for multi-objective loss functions.
The text was updated successfully, but these errors were encountered: