def result_extractor(train_obj):
 import numpy
 channels = train_obj.model.monitor.channels
 train_cost = channels['sgd_cost(ExhaustiveSGD[X])']
 best_epoch = numpy.argmin(train_cost.val_record)
 best_rec_error = train_cost.val_record[best_epoch]
 batch_num = train_cost.batch_record[best_epoch]
 return dict(best_epoch=best_epoch, train_rec_error=best_rec_error, batch_num=batch_num)

def result_extractor ( train_obj ) : import numpy channels = train_obj . model . monitor . channels train_cost = channels [ 'sgd_cost(ExhaustiveSGD[X])' ] best_epoch = numpy . argmin ( train_cost . val_record ) best_rec_error = train_cost . val_record [ best_epoch ] batch_num = train_cost . batch_record [ best_epoch ] return dict ( best_epoch = best_epoch , train_rec_error = best_rec_error , batch_num = batch_num )
this is a user specific function .