Esempio n. 1
0
__author__ = 'Andres'
from financialdata import StockData

name='acs'
data = StockData()
data.readData('stockprices/'+name+'.txt')
data.normalizeData()
data.delayInputs()
data.plotData()
from financialdata import StockData
from financialmodel import FinancialNetwork
from evolinotrainer import EvolinoTrainer, EvolinoEvaluation
from pylab import plot, show, ion, cla, subplot, title, figlegend, draw
from pybrain.tools.customxml.networkwriter import NetworkWriter
import numpy as np
import matplotlib.pyplot as plt
import pylab

name = "acs"

data = StockData()
data.readData("stockprices/" + name + ".txt")
data.normalizeData()
data.delayInputs()
data.createSequentialDataSets()

model = FinancialNetwork(data.trainData.indim, data.trainData.outdim, hiddim=10)

trainer = EvolinoTrainer(
    model,
    data.trainData,
    subPopulationSize=20,
    nParents=8,
    nCombinations=2,
    initialWeightRange=(-0.1, 0.1),
    mutationAlpha=0.001,
    nBurstMutationEpochs=np.Infinity,
    verbosity=2,
)