drbenvincent / darc_toolbox

Run adaptive decision making experiments
MIT License
16 stars 2 forks source link

bug: another divide by zero error in design_optimisation.py #21

Closed drbenvincent closed 5 years ago

drbenvincent commented 5 years ago
File "../../bad/optimisation.py", line 89, in design_optimisation
    U = (1/nD)*np.ones(nD)
ZeroDivisionError: division by zero

Maybe zero designs are being passed in? Overaggressive culling of designs in the heuristic code?

This definitely happens when we forget to provide inputs to one of the design variables. So:

There may or may not be other things which cause this error.

Add some asserts:

drbenvincent commented 5 years ago

No designs being available was the primary (only?) cause of this error, and it is now being caught and warned about in multiple places. The problem was primarily happening when we had a mis-structured design space spec that we were asking for in the magnitude effect style design spaces. This is a separate issue, see #28.