-
Notifications
You must be signed in to change notification settings - Fork 12
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 derivative for diag
and vec
#24
Comments
I tried to define these as follows:
But this doesn't work:
|
Hmm, looks like adjoint (e.g. By the way, errors like:
referring indexing with
Although in this particular case a bit more of debugging seems to be needed. |
Thanks for having a look. I tried without the
Here's a shorter example of the same error:
|
Ok, let's start with something working - on branch
These warnings are related to
I thought I hacked it around with a set of very custom rules, but as it turns out it's very easy to go out from their scope. In you last example, derivative of Adjoint ( |
OK I start to see. The rule is correct for vectors:
but broadcasting also knows that a rowvector is not a matrix, but this isn't in the types of
|
Wow, actually it fixes most of the examples! With your rules modified a bit the following works without any errors or warnings:
Thanks for this excellent solution. I'm going to spent some more time on fixing adjoint example and then merge all the changes. |
OK, that's great! Clearly I was failing to overwrite the rules, or something. I wondered if it would be worth checking https://github.com/FluxML/Flux.jl/blob/master/src/tracker/lib/array.jl#L434-L442 |
I think Flux partially does the same thing as |
Unsurprisingly, Flux version works nearly as fast as I also fixed adjoint, so now all the examples in this issue work without errors or warnings. Thanks again for your input! Closing this issue since there seems nothing else to be fixed, but feel free to re-open if I missed something. |
Motivating example:
The text was updated successfully, but these errors were encountered: