This week we came up with an idea to easily test Iterative Machines.
The idea here was to provide callback methods that will trigger cancel_computation(). These callbacks will directly send a block signal to the signal handler and we are done.
This is also a nice functionality to have since a user might want to trigger pause/cancel when a condition is satisfied. This makes the framework more user friendly. Along with a lot easier tests.
Currently we use jinja2 to write tests to systematically test a bunch of algorithms. But jinja2 was being dropped from serialization tests. We could use that here because the test we designed will take the algorithm, prematurely stop it with a callback over number of iteration serialize the model, then we will compare results after deserializing it. What we test here is the fact that the algorithm is stoppable. We leverage this on the whether the model triggered the callback i.e. it had an iteration during the training phase.This can serve as a test for whether the model is iterative in nature as well.
As a cookbook patch I ported regression meta examples to the new API.
We also implemented the progress bar in all iterative algorithms too. This was a nice refactor that involved identifying a lot of iterative algorithms :).
Contributions:
Progress bar in iterative algorithms.
By my mentor