本文整理汇总了Python中nolearn.lasagne.NeuralNet.eval_size方法的典型用法代码示例。如果您正苦于以下问题:Python NeuralNet.eval_size方法的具体用法?Python NeuralNet.eval_size怎么用?Python NeuralNet.eval_size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nolearn.lasagne.NeuralNet
的用法示例。
在下文中一共展示了NeuralNet.eval_size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: str
# 需要导入模块: from nolearn.lasagne import NeuralNet [as 别名]
# 或者: from nolearn.lasagne.NeuralNet import eval_size [as 别名]
hidden1_num_units=1000,
dropout1_p=0.25,
hidden2_num_units=500,
dropout2_p=0.25,
#hidden3_num_units=128,
#dropout3_p=0.2,
output_num_units=num_classes,
output_nonlinearity=softmax,
update=adagrad,
update_learning_rate=0.01,
#update_momentum=0.9,
eval_size=0.2,
verbose=1,
max_epochs=150)
d = net0.__dict__
e = d['max_epochs']
subname = "d" + str(int(d['dropout0_p']*100)) + "_h" + str(d['hidden1_num_units']) + "_d" + str(int(d['dropout1_p']*100)) + "_h" + str(d['hidden2_num_units']) + "_d" + str(int(d['dropout2_p']*100)) + "_e" + str(d['max_epochs']) + "_l" + str(d['update_learning_rate'])
print(subname)
# fit the model
net0.fit(X, y)
net0.eval_size=0
# fit the model
net0.fit(X, y)
# add score to submission filename
score = "{:.4f}".format(net0.train_history_[e-1]['valid_loss'])
subname = "nnet_" + score + "_" + subname
make_submission(net0, X_test, ids, encoder, subname)