Created
August 11, 2020 11:01
-
-
Save krishvishal/3f3ea2e7bffa47eb29530bfffe275a8f to your computer and use it in GitHub Desktop.
This file has a function f(x) and I use ReverseDiff to calculate gradient of that function. If ReveseDiff is really the problem, this shouldn't run successfully.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ReverseDiff | |
f(x) = maximum(x;dims=1) | |
if abspath(PROGRAM_FILE) == @__FILE__ | |
x = rand(3, 3) | |
println(x) | |
println(ReverseDiff.gradient(sum∘f, x)) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment