From 553dd0c6370a37ca00dc75e60f75dad1b26725a4 Mon Sep 17 00:00:00 2001 From: Mitja Devetak Date: Thu, 22 Feb 2024 13:42:23 +0100 Subject: [PATCH] cleanup before registration --- src/ignore_gradient.jl | 4 ++-- src/sign_diff.jl | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 src/sign_diff.jl diff --git a/src/ignore_gradient.jl b/src/ignore_gradient.jl index 1eaef8c..e6d60ca 100644 --- a/src/ignore_gradient.jl +++ b/src/ignore_gradient.jl @@ -24,7 +24,7 @@ end Constructs a pass trough function for the given function `f` and gradient function `g`. The pass trough function is a function that returns the same value as `f` but the gradient is taken from `g`. Optional parameter k controls -the steepnes of the gradient, default is 1. +the steepnes of the gradient, default is 1. Supports both scalars and arrays. """ function construct_diff_version(f, g) @@ -38,7 +38,7 @@ function construct_diff_version(f, g) error("Type not supported only supports Number and AbstractArray.") end end - zero = g(x * k) .- ignore_gradient(g(x * k)) + zero = g(x .* k) .- ignore_gradient(g(x .* k)) return ignore_gradient(f(x)) .+ zero end return pass_trough_function diff --git a/src/sign_diff.jl b/src/sign_diff.jl deleted file mode 100644 index 8b13789..0000000 --- a/src/sign_diff.jl +++ /dev/null @@ -1 +0,0 @@ -