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 SymbolicRegression
using Random: MersenneTwister
using Enzyme
using MLJBase: machine, fit!, predict, report
using Test
X =let rng =MersenneTwister(0), n =30
(; x1=randn(rng, n), x2=randn(rng, n), class=rand(rng, 1:2, n))
end
y =let P1 = [0.1, 1.5], P2 = [3.2, 0.5]
[2*cos(x2 + P1[class]) + x1^2- P2[class] for (x1, x2, class) inzip(X.x1, X.x2, X.class)]
end
model =SRRegressor(;
niterations=100,
binary_operators=[+, *, /, -],
unary_operators=[cos, exp],
populations=30,
expression_type=ParametricExpression,
expression_options=(; max_parameters=2),
autodiff_backend=:Enzyme,
);
mach =machine(model, X, y)
fit!(mach)
Could it be because I am running Enzyme.jl from a task within the code?
More context: Enzyme.jl used to work for this, and I don't think I changed anything that would cause new behavior on my end. But I just switched to v0.13 so not sure if something changed. I can't test v0.12 due to the error here: #2080
The text was updated successfully, but these errors were encountered:
@MilesCranmer from the looks of it, it seems like this related to doing a first compile in a task
Separately, we've been consistently running the itnegration CI you made a while ago, and things continue to pass. Presumably that is set to the version at the time, so perhaps you can find what on your end changed to cause the issue?
The main difference is that the first compile on my system is in a worker thread, whereas in the CI, it’s the main thread. Nothing has changed on my side though.
When trying to use Enzyme as the autodiff backend for SymbolicRegression searches I ran into this error:
The full stack trace:
To reproduce, you can run the example here: https://ai.damtp.cam.ac.uk/symbolicregression/dev/examples/parameterized_function/ and swap
:Zygote
for:Enzyme
.For example:
Could it be because I am running Enzyme.jl from a task within the code?
More context: Enzyme.jl used to work for this, and I don't think I changed anything that would cause new behavior on my end. But I just switched to v0.13 so not sure if something changed. I can't test v0.12 due to the error here: #2080
The text was updated successfully, but these errors were encountered: