Trainer class for train iterative algorithm on single GPU.
There are two types of trainer in neuralgym: primary trainer and secondary trainer. For primary trainer, tensorflow related instances and configurations will be initialized, e.g. init all variables, summary writer, session, start_queue_runner and others. For the secondary trainer only train_ops and losses are iteratively updated/ran.
Parameters: callbacks – dict of callbacks
Initialize primary trainer context including:
- summary writer
Progress bar for logging.
Note all statistics are averaged over epoch.
Start training with callbacks.