回声状态预测懒惰

时间:2014-06-25 15:03:02

标签: artificial-intelligence neural-network time-series pybrain

我试图通过实施this solution来使用PyBrain进行时间序列预测。其他产生大的抵消。问题是虽然我已经尝试改变学习率,动量,最大训练时期,继续时期,神经元量(1-500)和激活功能,但结果总是平坦的。解决方案可能是什么?

蓝色:原创。绿色:网络的预测。 Blue: original. Green: network's prediction.

INPUTS = 60
HIDDEN = 60
OUTPUTS = 1

def build_network():
    net = buildNetwork(INPUTS, HIDDEN, OUTPUTS,
                       hiddenclass=LSTMLayer,
                       outclass=LinearLayer,
                       recurrent=True,
                       bias=True, outputbias=False)
    net.sortModules()
    return net

def prepare_datasets(data, training_data_ratio):
    training_data, validation_data = split_list(data, training_data_ratio)

    training_set = SequentialDataSet(INPUTS, OUTPUTS)
    for i in range(len(training_data) - INPUTS - 1):
        training_set.newSequence()
        tr_inputs = training_data[i:i + INPUTS]
        tr_output = training_data[i + INPUTS]
        training_set.addSample(tr_inputs, tr_output)

    validation_set = []
    for i in range(len(validation_data) - INPUTS - 1):
        validation_set.append(validation_data[i:i + INPUTS])
    return training_set, validation_set

def train_network(net, data, max_iterations):
    net.randomize()
    learning_rate = 0.1
    trainer = BackpropTrainer(net, data, verbose=True,
                              momentum=0.8,
                              learningrate=learning_rate)
    errors = trainer.trainUntilConvergence(maxEpochs=max_iterations, continueEpochs=10)
    return errors

def try_network(net, data):
    outputs = []
    for item in data:
        output = net.activate(item)[0]
        outputs.append(output)
    return outputs

1 个答案:

答案 0 :(得分:0)

规范化数据:

data = data / max(data)