Open jdumouchelle opened 2 years ago
Thanks @jdumouchelle. The code looks good to me, however I'm wondering if we should make this future-proof.
Today someone asks to use the number of nodes in the abscissa, next time it's the LP iterations...
Perhaps we could add a callback, just like we did for bound_function
(and add a some aliases to make it easier to use).
At a more abstract level, I believe Integral
should in fact be more of an operator. In the same way that we can sum two reward functions, we could make it so that Integral can be computed for any two reward function (one for the abscissa and one for the ordinate).
Yes I agree. It did come across my mind, but it will likely require a decent amount of time. Perhaps we can merge this for now so it can be used by Aaron, open an issue for a more general integral reward, and discuss it in there. After that, I will work on when I have more time.
Pull request checklist
Proposed implementation
Implementation of primal, dual, and primal dual integrals with respect to number of nodes.
From the perspective of the user, one can simply pass
use_nnodes=True
into the constructor of any of the integral reward functions.