You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using DynamicExpressions
using Enzyme
operators =OperatorEnum(binary_operators=(+, -, *, /), unary_operators=(cos, sin))
x1 =Node{Float64}(feature=1)
x2 =Node{Float64}(feature=2)
tree =0.5* x1 +cos(x2 -0.2)
X = [1.02.03.0; 4.05.06.0] # 2x3 matrix (2 features, 3 rows)functionmy_loss_function(tree, X, operators)
# Get the outputs
y =tree(X, operators)
# Sum them (so we can take a gradient, rather than a jacobian)returnsum(y)
end
dX =begin
storage=zero(X)
autodiff(
Reverse,
my_loss_function,
Active,
## Actual arguments to function:Const(tree),
Duplicated(X, storage),
Const(operators),
)
storage
end
The text was updated successfully, but these errors were encountered:
I ran the example in DynamicExpression.jl's documentation: https://ai.damtp.cam.ac.uk/dynamicexpressions/dev/eval/#Enzyme that does a simple evaluation. This used to work fine on v0.12.(?) but on v0.12.36. it throws this error:
The MWE is as follows:
The text was updated successfully, but these errors were encountered: