-
Notifications
You must be signed in to change notification settings - Fork 36
Fixing implicit gradients #141
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
Conversation
@willtebbutt @sharanry This correction is very important for me (AGP.jl relies completely on it). So I would merge it and release a new breaking release tonight. |
I'll try and take a look at this this evening. |
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.
Just a quick question.
src/transform/scaletransform.jl
Outdated
(t::ScaleTransform)(x) = first(t.s) * x | ||
|
||
_map(t::ScaleTransform, x::AbstractVector{<:Real}) = first(t.s) .* x | ||
_map(t::ScaleTransform, x::ColVecs) = ColVecs(first(t.s) .* x.X) | ||
_map(t::ScaleTransform, x::RowVecs) = RowVecs(first(t.s) .* x.X) | ||
_map(t::ScaleTransform, x::AbstractVector{<:Real}) = t(x) | ||
_map(t::ScaleTransform, x::ColVecs) = ColVecs(t(x.X)) | ||
_map(t::ScaleTransform, x::RowVecs) = RowVecs(t(x.X)) |
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.
Do you know why this code needs to change? It's unclear to me as it's already using the _map
function.
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.
Yeah that is not necessary! Sorry for the noise. I thought it was nicer to have a more uniform approach
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.
I think I actually prefer the way it was written previously 😬
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.
Ok I will revert it back
Until now there was a major issue where implicit gradients on
TransformedKernel
, i.e. :would return nothing.
This fixes #137 by not using map to apply the transform operation and adds tests to check the behaviour