def build_network(layers):
"""
Builds and returns a NeuralNet object
"""
return NeuralNet(
layers = layers,
batch_iterator_train = CropBatchIterator(batch_size=256),
update = nesterov_momentum,
update_learning_rate = theano.shared(float32(0.03)),
update_momentum = theano.shared(float32(0.9)),
on_epoch_finished=[
AdjustVariable('update_learning_rate', start=0.03, stop=0.0001),
AdjustVariable('update_momentum', start=0.9, stop=0.999),
EarlyStopping(patience=10),
],
regression = False,
max_epochs = 100,
verbose = 2
)
# --------------- Training the network ---------------
评论列表
文章目录