0
回答
为什么pybrain 输出的结果 是一样的
华为云实践训练营,热门技术免费实践!>>>   
from pybrain.tools.shortcuts import buildNetwork                                
from pybrain.datasets import SupervisedDataSet                                  
from pybrain.supervised.trainers import BackpropTrainer


net = buildNetwork(2, 3, 1)  
net.randomize()                                                    


ds = SupervisedDataSet(2, 1)                                                       
ds.addSample([77, 78], 77)                                                         
ds.addSample([78, 76], 76)                                                         
ds.addSample([76, 76], 75)                                                         




trainer = BackpropTrainer(net, ds, learningrate = 0.01, momentum = 0.99, verbose = True)


                                               
for epoch in range(0, 1000):                                                                   
    error = trainer.train()                                                                    
    if error < 0.001:                                                                          
        break                                                      


print net.activate([77, 78])                                                       
print net.activate([78, 76])                                                       
print net.activate([76, 76])



输出结果是:

[ 75.93901581]
[ 75.93901581]
[ 75.93901581]

全是一样的,我那里错了呢?

举报
漠阳风
发帖于3年前 0回/169阅
顶部