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


Python NeuralNetwork.back_propagation方法代码示例

本文整理汇总了Python中NeuralNetwork.NeuralNetwork.back_propagation方法的典型用法代码示例。如果您正苦于以下问题:Python NeuralNetwork.back_propagation方法的具体用法?Python NeuralNetwork.back_propagation怎么用?Python NeuralNetwork.back_propagation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NeuralNetwork.NeuralNetwork的用法示例。


在下文中一共展示了NeuralNetwork.back_propagation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run_iris_comparison

# 需要导入模块: from NeuralNetwork import NeuralNetwork [as 别名]
# 或者: from NeuralNetwork.NeuralNetwork import back_propagation [as 别名]
def run_iris_comparison(num=25):
    """ Compare a few different test and
    training configurations
    """
    print("Running neural network {} times each for three different sets of training and testing files".format(num))
    test_files = ['iris_tes.txt', 'iris_tes50.txt',\
            'iris_tes30.txt']
    train_files = ['iris_tra.txt', 'iris_tra100.txt',\
            'iris_tra120.txt']

    for i in range(0, len(test_files)):
        print("trainfile = {}     testfile = {}".format(train_files[i], test_files[i]))

    config_obj = openJsonConfig('conf/annconfig_iris.json')
    summary = {}

    for i in range(0, len(test_files)):
        config_obj['testing_file'] = test_files[i]
        config_obj['training_file'] = train_files[i]
        config_obj['plot_error'] = False
        config_obj['test'] = False
        crates = []

        for j in range(0, num):
            nn = NeuralNetwork(config_obj)
            nn.back_propagation()
            cmat, crate, cout = nn.classification_test(nn.testing_data, nn.weights_best)
            crates.append(crate)
        summary[config_obj['testing_file']] =\
            nn_stats(np.array(crates))
    print print_stat_summary(summary) 
开发者ID:beparadox,项目名称:neural_networks,代码行数:33,代码来源:runNN.py

示例2: run_reg_nn

# 需要导入模块: from NeuralNetwork import NeuralNetwork [as 别名]
# 或者: from NeuralNetwork.NeuralNetwork import back_propagation [as 别名]
def run_reg_nn():
    nn = NeuralNetwork('fake_config.json')
    nn.back_propagation()
    #plot_error(nn)
    return nn
开发者ID:beparadox,项目名称:neural_networks,代码行数:7,代码来源:runNN.py

示例3: test_nn

# 需要导入模块: from NeuralNetwork import NeuralNetwork [as 别名]
# 或者: from NeuralNetwork.NeuralNetwork import back_propagation [as 别名]
def test_nn(config):
    nn = NeuralNetwork(config)
    nn.back_propagation()
    cmat, crate, cout = nn.classification_test(nn.testing_data, nn.weights_best)
    print cmat
    print crate
开发者ID:beparadox,项目名称:neural_networks,代码行数:8,代码来源:runNN.py

示例4: run_nn

# 需要导入模块: from NeuralNetwork import NeuralNetwork [as 别名]
# 或者: from NeuralNetwork.NeuralNetwork import back_propagation [as 别名]
def run_nn(config):
    nn = NeuralNetwork(config)
    nn.back_propagation()
开发者ID:beparadox,项目名称:neural_networks,代码行数:5,代码来源:runNN.py

示例5: run_xor

# 需要导入模块: from NeuralNetwork import NeuralNetwork [as 别名]
# 或者: from NeuralNetwork.NeuralNetwork import back_propagation [as 别名]
def run_xor():
    nn = NeuralNetwork('xor.json')
    nn.back_propagation()
    plot_error(nn)
开发者ID:beparadox,项目名称:neural_networks,代码行数:6,代码来源:runNN.py


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