Skip to content

Commit

Permalink
name change to 1D gaussian
Browse files Browse the repository at this point in the history
  • Loading branch information
vpuri3 committed May 13, 2024
1 parent dd900ae commit e4e7be7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
@inline function rbf(x, z, h)
# exp(-((x - z)/h)^2)
y = (x - z) / h
negative_exp_square(y)
gaussian1D(y)
end

@inline negative_exp_square(x) = exp(-x^2)
@inline gaussian1D(x) = exp(-x^2)

function CRC.rrule(::typeof(negative_exp_square), x)
function CRC.rrule(::typeof(gaussian1D), x)
T = eltype(x)
y = negative_exp_square(x)
negative_exp_square(ȳ) = -T(2) * x * y *
y = gaussian1D(x)
gaussian1D(ȳ) = -T(2) * x * y *

return y, ∇negative_exp_square
return y, ∇gaussian1D
end

# from https://github.com/LuxDL/Lux.jl/pull/627
Expand Down

0 comments on commit e4e7be7

Please sign in to comment.