Commit f2765b9
Replace -inf, +inf, NaN in programs metrics by None before visualizing (#384)
When the visualizer import data from a checkpoint, this is sent to the
javascript via a response object decoded with `resp.json()` in
`fetchAndRender()` from "main.js".
This is crashing if it does not respect fully json specs
(and NaN, Infinity are not json valid even though js objects).
This is useful for evolutions based on positive metrics to minimize (like a cost).
In that case, we want to put -metric in combined_score (which will then
be negative).
Thus an evolved program not working should be given a worse score during
evaluation. An easy way to do it is to put -inf (instead of not outputing any
metric, which will be replaced by a 0 by default by the database when
requesting a fitness).
Doing so works well during evolution (ranking the top programs as
expected), but during visualization, it was raising an error when fetching data.
Co-authored-by: Nolwen <nolwen.huet@imacs.polytechnique.fr>1 parent 75505f6 commit f2765b9
1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| |||
84 | 88 | | |
85 | 89 | | |
86 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
87 | 103 | | |
88 | 104 | | |
89 | 105 | | |
| |||
0 commit comments