Skip to content

Commit

Permalink
Convert Inf to large num in recorder
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Jun 21, 2021
1 parent 31c3dc6 commit 124020d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Population.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ 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"=>member.score,
"loss"=>inf_to_num(member.score),
"complexity"=>countNodes(member.tree),
"birth"=>member.birth,
"ref"=>member.ref,
Expand Down

0 comments on commit 124020d

Please sign in to comment.