本文整理汇总了Python中simulation.Simulation.dgraph方法的典型用法代码示例。如果您正苦于以下问题:Python Simulation.dgraph方法的具体用法?Python Simulation.dgraph怎么用?Python Simulation.dgraph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simulation.Simulation
的用法示例。
在下文中一共展示了Simulation.dgraph方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: step_statictics
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dgraph [as 别名]
pass
def step_statictics(simu, network, plot, inputs, outputs):
#rms
pass
def step_learn(network, inputs, outputs):
#Learning
network['FoN2'].train(inputs, outputs)
for i in range(len(outputs)):
network['FoN'][i].train(inputs, outputs[i])
sim = Simulation(data, nbr_network, [FoN, FoN2])
sim.dgraph(['FoN_rms'])
sim.launch(nbr_epoch, nbr_try, step_propagation, step_statictics, step_learn)
#show_repr(sim.networks[0]['FoN'].hiddenNeurons[0].weights, 4)
# for i in range(10):
# build_matrice(sim.networks[0]['FoN'].outputNeurons[i].weights, sim.networks[0]['FoN'].hiddenNeurons, 4)
width = 4
# MLP
on = []
hn = []
for net in sim.networks:
on.append(net['FoN2'].outputNeurons)
hn.append(net['FoN2'].hiddenNeurons)
示例2: moregraph2
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dgraph [as 别名]
def moregraph2(plt):
plt.title('Classification performance of first-order and high-order networks')
plt.ylabel('ERROR')
plt.xlabel("EPOCHS")
plt.axis((0, nbr_epoch, 0, 1.01))
def moregraph3(plt):
plt.title('Classification performance of first-order and feedback networks')
plt.ylabel('ERROR')
plt.xlabel("EPOCHS")
plt.axis((0, nbr_epoch, 0, 1.01))
sim = Simulation(nbr_epoch, 0, data, nbr_network, [FoN, SoN, feedback])
sim.dgraph(['FoN_rms', 'SoN_rms', 'FoN_perf', 'SoN_perf', 'high_wager', 'feedback'], [])
seed(100)
sim.launch(nbr_try, step_propagation, step_statictics, step_learn)
sim.plot(point, 'FoN_rms', ['FoN_rms', 'SoN_rms'],
["FoN" , "SoN"],
[3, 3 ], moregraph1)
sim.plot(point, 'FoN_rms', ['FoN_perf', 'SoN_perf', 'high_wager'],
["FoN ( winner take all )" , "SoN (wagering) ", "High wager"],
[3, 3, 2 ], moregraph2)
sim.plot(point, 'FoN_perf', ['FoN_perf', 'feedback'],
["FoN" , "Feedback"],
[3, 3 ], moregraph3)
示例3: moregraph2
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dgraph [as 别名]
def moregraph2(plt):
plt.title('Classification performance of first-order and high-order networks')
plt.ylabel('ERROR')
plt.xlabel("EPOCHS")
plt.axis((0, nbr_epoch, 0, 1.01))
def moregraph3(plt):
plt.title('Classification performance of first-order and control networks')
plt.ylabel('ERROR')
plt.xlabel("EPOCHS")
plt.axis((0, nbr_epoch, 0, 1.01))
sim = Simulation(nbr_epoch, 0, data, nbr_network, [control, FoN, SoN])
sim.dgraph(['FoN_rms', 'SoN_rms', 'FoN_perf', 'SoN_perf', 'high_wager', 'control_rms', 'control_perf'], [])
seed(100)
sim.launch(nbr_try, step_propagation, step_statictics, step_learn)
sim.plot(point, 'FoN_rms', ['FoN_rms', 'SoN_rms', 'control_rms'],
["FoN" , "SoN", "Control"],
[3, 3, 3 ], moregraph1)
sim.plot(point, 'FoN_rms', ['FoN_perf', 'SoN_perf', 'high_wager'],
["FoN ( winner take all )" , "SoN (wagering) ", "High wager"],
[3, 3, 2 ], moregraph2)
sim.plot(point, 'FoN_perf', ['FoN_perf', 'control_perf'],
["FoN" , "Control"],
[3, 3 ], moregraph3)
示例4: moregraph1
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dgraph [as 别名]
def moregraph1(plt):
plt.title('Error RMS error of first-order and high-order networks')
plt.ylabel('RMS ERROR')
plt.xlabel("EPOCHS")
def moregraph2(plt):
plt.title('Classification error of first-order and high-order networks')
plt.ylabel('ERROR')
plt.xlabel("EPOCHS")
plt.axis((0, nbr_epoch, 0, 1.05))
sim = Simulation(nbr_epoch, width, data, nbr_network, [FoN, SoN])
sim.dgraph(['FoN_rms', 'SoN_rms', 'SoN_rms_input', 'SoN_rms_hidden', 'SoN_rms_output', 'FoN_err',
'SoN_err_input', 'SoN_err_hidden', 'SoN_err_output'], [Simulation.DISCRETIZE])
sim.launch(nbr_try, step_propagation, step_statictics, step_learn)
sim.plot(12, 'FoN_rms', ['FoN_rms', 'SoN_rms', 'SoN_rms_input', 'SoN_rms_hidden', 'SoN_rms_output'],
["FoN" , "SoN", "SoN input layer", "SoN hidden layer", "SoN output layer"],
[3, 3, 2, 2 , 2 ], moregraph1)
sim.plot(12, 'FoN_rms', ['FoN_err', 'SoN_err_input', 'SoN_err_hidden', 'SoN_err_output'],
["FoN ( winner take all )" , "SoN input layer ( x > 0.5 => activation )", "SoN hidden layer ( | x - o | <= 0.3 )",
"SoN output layer ( winner take all )"],
[3, 2, 2, 2 ], moregraph2)
sim.custom_plot([Simulation.DISCRETIZE, Simulation.PROTOTYPE])
#Representations hidden
示例5: Simulation
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dgraph [as 别名]
plt.xlabel("EPOCHS")
plt.axis((0, nbr_epoch * 4, -0.01, 1.01))
sim = Simulation(nbr_epoch, 0, data, nbr_network, [FoN, SoN, FoN2, SoN2])
sim.dgraph(
[
"FoN_rms",
"SoN_rms",
"SoN_rms_input",
"SoN_rms_hidden",
"SoN_rms_output",
"FoN_err",
"SoN_err_input",
"SoN_err_hidden",
"SoN_err_output",
"FoN2_rms",
"SoN2_rms",
"SoN2_rms_input",
"SoN2_rms_hidden",
"SoN2_rms_output",
"FoN2_err",
"SoN2_err_input",
"SoN2_err_hidden",
"SoN2_err_output",
],
[],
)
sim.launch(nbr_try, step_propagation, step_statictics, step_learn)
for k in range(len(sim.examples.outputs)):
newtask(sim.examples.outputs[k])
示例6: moregraph1
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dgraph [as 别名]
def moregraph1(plt):
plt.title('Error RMS error of first-order and high-order networks')
plt.ylabel('RMS ERROR')
plt.xlabel("EPOCHS")
def moregraph2(plt):
plt.title('Classification error of first-order and high-order networks')
plt.ylabel('ERROR')
plt.xlabel("EPOCHS")
sim = Simulation(nbr_epoch, 0, data, nbr_network, [FoN, SoN, FoN2, SoN2])
sim.dgraph(['FoN_rms', 'SoN_rms', 'SoN_rms_input', 'SoN_rms_hidden', 'SoN_rms_output', 'FoN_err',
'SoN_err_input', 'SoN_err_hidden', 'SoN_err_output', 'FoN2_rms', 'SoN2_rms', 'SoN2_rms_input',
'SoN2_rms_hidden', 'SoN2_rms_output', 'FoN2_err',
'SoN2_err_input', 'SoN2_err_hidden', 'SoN2_err_output'], [])
sim.launch(nbr_try, step_propagation, step_statictics, step_learn)
for k in range(len(sim.examples.outputs)):
newtask(sim.examples.outputs[k])
sim.launch(nbr_try, step_propagation, step_statictics, step_learn2)
for k in range(len(sim.examples.outputs)):
newtask2(sim.examples.outputs[k])
sim.launch(nbr_try, step_propagation, step_statictics, step_learn2)
for k in range(len(sim.examples.outputs)):
newtask3(sim.examples.outputs[k])
示例7: moregraph2
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dgraph [as 别名]
plt.xlabel("EPOCHS")
def moregraph2(plt):
plt.title("Classification error of first-order and high-order networks")
plt.ylabel("ERROR")
plt.xlabel("EPOCHS")
plt.axis((0, nbr_epoch, 0, 1.05))
sim = Simulation(nbr_epoch, width, data, nbr_network, [FoN, SoN])
sim.dgraph(
[
"FoN_rms",
"SoN_rms",
"SoN_rms_input",
"SoN_rms_hidden",
"SoN_rms_output",
"FoN_err",
"SoN_err_input",
"SoN_err_hidden",
"SoN_err_output",
],
[Simulation.DISCRETIZE],
)
sim.launch(nbr_try, step_propagation, step_statictics, step_learn)
sim.plot(
12,
"FoN_rms",
["FoN_rms", "SoN_rms", "SoN_rms_input", "SoN_rms_hidden", "SoN_rms_output"],
["FoN", "SoN", "SoN input layer", "SoN hidden layer", "SoN output layer"],
[3, 3, 2, 2, 2],
moregraph1,
示例8: moregraph1
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dgraph [as 别名]
network['FoN'].set_learning_rate(l)
network['FoN'].set_momentum(m)
network['FoN'].train(inputs, outputs)
network['control'].train(inputs, outputs)
def moregraph1(plt):
plt.title('Error RMS error of first-order and high-order networks')
plt.ylabel('RMS ERROR')
plt.xlabel("EPOCHS")
def moregraph3(plt):
plt.title('Classification performance of first-order and control networks')
plt.ylabel('ERROR')
plt.xlabel("EPOCHS")
plt.axis((0, nbr_epoch, 0, 1.01))
sim = Simulation(nbr_epoch, 0, data, nbr_network, [FoN, SoN, control])
sim.dgraph(['FoN_rms', 'FoN_perf', 'control_rms', 'control_perf', 'momentum', 'lrate'], [])
seed(100)
sim.launch(nbr_try, step_propagation, step_statictics, step_learn)
sim.plot(point, 'FoN_rms', ['FoN_rms', 'control_rms'],
["FoN" , 'control'],
[3, 2, 3 ], moregraph1)
sim.plot(point, 'FoN_perf', ['FoN_perf', 'control_perf', 'momentum', 'lrate'],
["FoN" , "Control", 'momentum', 'learning rate'],
[3, 3, 2, 2 ], moregraph3)