Skip to content

Commit

Permalink
Merge pull request #36 from cobac/master
Browse files Browse the repository at this point in the history
Allow infinities in recorder
  • Loading branch information
MilesCranmer authored Jun 22, 2021
2 parents 124020d + ddf252e commit 65dbd0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/Population.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ end


function record_population(pop::Population{T}, options::Options)::RecordType where {T<:Real}
inf_to_num = x -> isinf(x) ? convert(T, 1e9) : x
RecordType("population"=>[RecordType("tree"=>stringTree(member.tree, options),
"loss"=>inf_to_num(member.score),
"loss"=>member.score,
"complexity"=>countNodes(member.tree),
"birth"=>member.birth,
"ref"=>member.ref,
Expand Down
2 changes: 1 addition & 1 deletion src/SymbolicRegression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ function _EquationSearch(::ConcurrencyType, datasets::Array{Dataset{T}, 1};

@recorder begin
open(options.recorder_file, "w") do io
JSON3.write(io, record)
JSON3.write(io, record, allow_inf = true)
end
end

Expand Down

0 comments on commit 65dbd0e

Please sign in to comment.