当前位置: 首页>>代码示例>>Python>>正文


Python Simulation.dgraph方法代码示例

本文整理汇总了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)
开发者ID:matthieu637,项目名称:anne,代码行数:33,代码来源:representation.py

示例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)
     
开发者ID:matthieu637,项目名称:anne,代码行数:32,代码来源:expF6.py

示例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)
     
开发者ID:matthieu637,项目名称:anne,代码行数:32,代码来源:expG2.py

示例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
开发者ID:matthieu637,项目名称:anne,代码行数:34,代码来源:expA3.py

示例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])
开发者ID:matthieu637,项目名称:anne,代码行数:33,代码来源:expB2.py

示例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])
开发者ID:matthieu637,项目名称:anne,代码行数:34,代码来源:expB1.py

示例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,
开发者ID:matthieu637,项目名称:anne,代码行数:34,代码来源:expA4.py

示例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)
        
开发者ID:matthieu637,项目名称:anne,代码行数:31,代码来源:expD4.py


注:本文中的simulation.Simulation.dgraph方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。