def assert_progress(model, data, algo='sgd'):
    trainer = model.itertrain(
        data, algo=algo, momentum=0.5, batch_size=3, max_gradient_norm=1)
    train0, valid0 = next(trainer)
    train1, valid1 = next(trainer)
    assert train1['loss'] < valid0['loss']   # should have made progress!
    assert valid1['loss'] == valid0['loss']  # no new validation occurred
dataset/ETHPy150Open lmjohns3/theanets/test/util.py/assert_progress/original