uber-research / deep-neuroevolution

Deep Neuroevolution
Other
1.63k stars 298 forks source link

proposed fix for nan error in vine #21

Closed cliff-bohm closed 5 years ago

cliff-bohm commented 5 years ago

in visual_inspector/figure_base/load_data.py

the line:

cind = (fitness - minfit)/(maxfit - minfit) * gs.numBins

will result in a nan error when maxfit == minfit

I suggest:

if maxfit == minfit:
    cind = 0.0
else:    
    cind = (fitness - minfit)/(maxfit - minfit) * gs.numBins
ruiwang2uber commented 5 years ago

Good point. Would you like to put it in a pull request? I will be happy to merge it