Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] TaskFailedException due to domain error #116

Closed
MilesCranmer opened this issue Feb 22, 2022 · 2 comments
Closed

[BUG] TaskFailedException due to domain error #116

MilesCranmer opened this issue Feb 22, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@MilesCranmer
Copy link
Owner

MilesCranmer commented Feb 22, 2022

It seems like there are still some domain errors in very rare edge cases (~one in a billion!). This is the traceback:

    nested task error: TaskFailedException
    Stacktrace:
     [1] wait
       @ ./task.jl:334 [inlined]
     [2] fetch
       @ ./task.jl:349 [inlined]
     [3] (::SymbolicRegression.var"#60#98"{Vector{Vector{Task}}, Int64, Int64})()
       @ SymbolicRegression ./task.jl:423
    
        nested task error: DomainError with Inf:
        cos(x) is only defined for finite x.
        Stacktrace:
          [1] cos_domain_error(x::Float32)
            @ Base.Math ./special/trig.jl:97
          [2] cos(x::Float32)
            @ Base.Math ./special/trig.jl:108
          [3] deg1_l1_ll0_eval(tree::Node, cX::Matrix{Float32}, #unused#::Val{1}, #unused#::Val{2}, options::Options{Tuple{typeof(*), typeof(/), typeof(+), typeof(-)}, Tuple{typeof(sin), typeof(cos), typeof(exp), typeof(log_abs)}, L2DistLoss})
            @ SymbolicRegression.../EvaluateEquation.jl ~/miniconda3/envs/pysr/share/julia/packages/SymbolicRegression/Z2pqJ/src/EvaluateEquation.jl:175
          [4] evalTreeArray(tree::Node, cX::Matrix{Float32}, options::Options{Tuple{typeof(*), typeof(/), typeof(+), typeof(-)}, Tuple{typeof(sin), typeof(cos), typeof(exp), typeof(log_abs)}, L2DistLoss})
            @ SymbolicRegression.../EvaluateEquation.jl ~/miniconda3/envs/pysr/share/julia/packages/SymbolicRegression/Z2pqJ/src/EvaluateEquation.jl:31
          [5] deg2_eval(tree::Node, cX::Matrix{Float32}, #unused#::Val{4}, options::Options{Tuple{typeof(*), typeof(/), typeof(+), typeof(-)}, Tuple{typeof(sin), typeof(cos), typeof(exp), typeof(log_abs)}, L2DistLoss})

In principle these should be caught before evaluating the operator (and inf loss returned), but it looks like there are some cases where it is not caught. Will need to debug on the Julia side.

@MilesCranmer
Copy link
Owner Author

Cross posted to MilesCranmer/SymbolicRegression.jl#71 - will focus on the issue there since the bug is on the Julia side.

@MilesCranmer
Copy link
Owner Author

This should be fixed with v0.7.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant