(refactor) LearnerND._ask can be refactored to be so much more readable
IT would be especially useful to split the method into multiple functions, with each function having only one simple specific task
The following discussion from !68 (merged) should be addressed:
-
@jbweston started a discussion: IMO this loop could benefit from factoring parts out, or perhaps merely commenting different code blocks.
My understanding of the algorithm is that we pick the simplex with the biggest loss, and add a point there.
The extra complications come from the fact that (if I understand correctly), a given simplex may have a "subtriangulation" of pending points.
At the moment we maintain 2 data structures
losses
andpending_losses
. Perhaps we could treat these on the same footing, e.g. by storing the triangulation along with the simplices (we can discuss this in person). This would hopfully allow us to reduce the number of conditional statements in the loop body.