本文整理汇总了Python中simulation.Simulation.plot方法的典型用法代码示例。如果您正苦于以下问题:Python Simulation.plot方法的具体用法?Python Simulation.plot怎么用?Python Simulation.plot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simulation.Simulation
的用法示例。
在下文中一共展示了Simulation.plot方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import plot [as 别名]
def main():
# ./experiment -N 1024 -K 1 -B 4 -E 2 -L 8 -l 5 -r 4 -t 1e-8 -e 1e-8
params = Parameters(
n=1024,
k=1,
B_k_location=4,
B_k_estimation=2,
estimation_loops=8,
location_loops=5,
loop_threshold=4,
tolerance_location=1e-8,
tolerance_estimation=1e-8
)
from simulation import Simulation
sim = Simulation(params=params)
sim.plot()
execute(params=params, x=sim.x, simulation=sim)
plt.show()
示例2: moregraph2
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import plot [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)
示例3: moregraph2
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import plot [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)
示例4: moregraph2
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import plot [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)
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
graph_networkhidden(sim.networks[0]['FoN'], width, (8,8,1))
#Representations
示例5: range
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import plot [as 别名]
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])
sim.launch(nbr_try, step_propagation, step_statictics, step_learn2)
sim.plot(
48,
"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(
48,
"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],
示例6: moregraph1
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import plot [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)