コード例 #1
0
ファイル: script.py プロジェクト: udarapathmin/mtit-python
from matplotlib import cm
from neural_network import Neural_Network
from trainer import Trainer

NeuralNetwork = Neural_Network()

#Pass to Trainer Data:
X,Y = NeuralNetwork.readInputFile("input.txt")
Y = np.reshape(Y, (3,1))
print ("Input : ")
print (X)
print ("Results : ")
print (Y)

#normalized training data
X = NeuralNetwork.normalize(X)
Y = Y/100

print ("Input : ")
print (X)
print ("Results :")
print (Y)

TrainObject = Trainer(NeuralNetwork)
x, y, z = TrainObject.train(X,Y)

yHat = NeuralNetwork.forward(X)

print("YHat")
print(yHat)
print("Y")