@trainer.on(Events.ITERATION_STARTED(once=config['stop_iteration']))
def _():
    logger.info('Stop training on {} iteration'.format(trainer.state.iteration))
    trainer.terminate()
@trainer.on(Events.ITERATION_STARTED(once=config['stop_iteration']))
def _():
    logger.info('Stop training on {} iteration'.format(trainer.state.iteration))
    trainer.terminate()