本文整理汇总了Python中mlp.MLP.get_trainingError方法的典型用法代码示例。如果您正苦于以下问题:Python MLP.get_trainingError方法的具体用法?Python MLP.get_trainingError怎么用?Python MLP.get_trainingError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mlp.MLP
的用法示例。
在下文中一共展示了MLP.get_trainingError方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_mlp
# 需要导入模块: from mlp import MLP [as 别名]
# 或者: from mlp.MLP import get_trainingError [as 别名]
def run_mlp(dataset_path, neurons):
dataset_input = np.loadtxt(dataset_path)
dataset_output = dataset_input[:, - 1]
input = dataset_input[:,:-1]
print(input)
print(dataset_output)
scv = SCV(dataset_input, 5)
training, training_out, validation, validation_out = scv.select_fold_combination()
print("training ", training)
print("training out ",training_out)
print("validation ",validation)
print("validation_out ", validation_out)
hide = np.array([int(neurons)])
print(training.shape[1])
print(hide[0])
ann = MLP(training.shape[1],training.shape[1], hide)
ann.set_learningRate(0.95)
ann.set_learningDescent(0.5)
ann.set_momentum(0.02)
ann.set_erro(0.005)
ann.validation_set(validation, validation)
ann.train_mlp(training, training)
print("Validation Error: ", ann.get_validationError())
print("Training Error: ", ann.get_trainingError())
title = str(neurons) + " Neurons"
#ann.plot_learning_curve(title)
ann.plot_neurons(title)