Skip to content

Commit

Permalink
delete zygote dependency in runtests.jl
Browse files Browse the repository at this point in the history
deleted zygote dependency
  • Loading branch information
marlenaweidenauer authored Apr 18, 2024
1 parent 6cef54c commit 0beeed1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,14 @@ end

end


using Zygote # For automatic differentiation

# Define model for 1D function f(x) = x^2 that uses autodiff
model = UMBridge.Model(
name = "quadratic",
inputSizes = [1],
outputSizes = [1],
supportsGradient = true,
evaluate = (input, config) -> input[1]^2,
gradient = (outWrt, inWrt, input, sens, config) -> (Zygote.gradient(x -> x^2, input[1])[1] * sens[1])
gradient = (outWrt, inWrt, input, sens, config) -> 2*input[1][1] * sens[1]
)

function testserver_autodiff_gradient(models)
Expand Down Expand Up @@ -206,7 +203,7 @@ model = UMBridge.Model(
outputSizes = [2],
supportsJacobian = true,
evaluate = (input, config) -> [input[1]^2, input[2]^2],
applyJacobian = (outWrt, inWrt, input, vec, config) -> Zygote.jacobian(x -> [x[1]^2, x[2]^2], input)[1] * vec
applyJacobian = (outWrt, inWrt, input, vec, config) -> [2*input[1][1] 0 ; 0 2*input[2][1]] * vec
)

function testserver_autodiff_jacobian(models)
Expand Down

0 comments on commit 0beeed1

Please sign in to comment.