-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathneuralnet.py
46 lines (33 loc) · 1.49 KB
/
neuralnet.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 1 21:02:04 2016
@author: Andi
"""
from inputlayer import InputLayer
from outputlayer import OutputLayer
from hiddenlayer import HiddenLayer
class NeuralNet():
def initNet(self):
inputLayer=InputLayer()
inputLayer.setnumberOfNeuronsInLayer(2)
numberOfHiddenLayers=3
listOfHiddenLayer=[]
for x in range(numberOfHiddenLayers):
hiddenLayer=HiddenLayer()
hiddenLayer.setnumberOfNeuronsInLayer(2)
listOfHiddenLayer.append(hiddenLayer)
outputLayer=OutputLayer()
outputLayer.setnumberOfNeuronsInLayer(1)
inputLayer.initLayer()
print(inputLayer.getnumberOfNeuronsInLayer())
hiddenLayer.initLayer(listOfHiddenLayer, inputLayer, outputLayer)
outputLayer.initLayer()
print(outputLayer.getnumberOfNeuronsInLayer())
print(inputLayer.getlistOfNeurons()[0].getlistofWeightIn())
print(listOfHiddenLayer[0].getlistOfNeurons()[0].getlistofWeightIn())
print(listOfHiddenLayer[0].getlistOfNeurons()[0].getlistofWeightOut())
print(listOfHiddenLayer[1].getlistOfNeurons()[0].getlistofWeightIn())
print(listOfHiddenLayer[1].getlistOfNeurons()[0].getlistofWeightOut())
print(outputLayer.getlistOfNeurons()[0].getlistofWeightIn())
test=NeuralNet()
test.initNet()