本文整理汇总了Python中trainer.Trainer.build方法的典型用法代码示例。如果您正苦于以下问题:Python Trainer.build方法的具体用法?Python Trainer.build怎么用?Python Trainer.build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trainer.Trainer
的用法示例。
在下文中一共展示了Trainer.build方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DeepCNN
# 需要导入模块: from trainer import Trainer [as 别名]
# 或者: from trainer.Trainer import build [as 别名]
))
model = DeepCNN(rng = rng)
print 'Creating the trainer'
trainer = Trainer(rng = rng,
train_set = train_set, valid_set = valid_set, test_set = test_set,
model = model, load_path = load_path, save_path = save_path,
zero_pad=zero_pad,
affine_transform_a=affine_transform_a, # a is (more or less) the rotations
affine_transform_b=affine_transform_b, # b is the translations
horizontal_flip=horizontal_flip,
LR = LR, LR_decay = LR_decay, LR_fin = LR_fin,
M = M,
BN = BN, BN_fast_eval=BN_fast_eval,
batch_size = batch_size, number_of_batches_on_gpu = number_of_batches_on_gpu,
n_epoch = n_epoch, monitor_step = monitor_step,
shuffle_batches = shuffle_batches, shuffle_examples = shuffle_examples)
print 'Building'
trainer.build()
print 'Training'
start_time = time.clock()
trainer.train()
end_time = time.clock()
print 'The training took %i seconds'%(end_time - start_time)