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


Python NeuralNet.train_history_[r]['train_loss']方法代码示例

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


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

示例1: create_stack

# 需要导入模块: from nolearn.lasagne import NeuralNet [as 别名]
# 或者: from nolearn.lasagne.NeuralNet import train_history_[r]['train_loss'] [as 别名]
normal_stack = create_stack(N)

print("Made stack!")

for k in range(0, 1000):
    saved_accuracy = 10011.0
    data = np.array(normal_stack + random.sample(coords, N))
    val = np.append(np.zeros(N), np.ones(N))
    data, val = shuffle(data, val)
    for i in range(0, int(EPOCHS)):
        nn.fit(data, val)
        cur_accuracy = nn.train_history_[-1]['valid_loss']
        if cur_accuracy - 0.004 > saved_accuracy:
            print("Test Loss Jump! Loading previous network!")
            with suppress_stdout():
                nn.load_params_from("cachedgooglenn2.params")
        else:
            nn.save_params_to('cachedgooglenn2.params')
            saved_accuracy = cur_accuracy
        nn.update_learning_rate *= DECAY

    normal_stack = update_stack(normal_stack, int(K*N), nn)

    print("Data Report: K={3:.2f}, Prob Before={0}, Prob After={1}, Overlap={2}".format(proba_before, proba_after, overlap, K))
    K += KGROWTH
    EPOCHS *= EGROWTH
    for r in range(len(nn.train_history_)):
        nn.train_history_[r]['train_loss'] = 10011.0

nn.save_params_to('googlenn2.params')
开发者ID:nikcheerla,项目名称:TCGA-Mitosis,代码行数:32,代码来源:googlenet.py


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