Commit 337545f7 authored by Artem Oppermann's avatar Artem Oppermann

final version

parent 48452bdf
......@@ -24,4 +24,4 @@ def get_mnist_data(n_samples=5000):
return mnist_data
#data=get_mnist_data()
\ No newline at end of file
data=get_mnist_data()
\ No newline at end of file
......@@ -10,6 +10,7 @@ val_after_iter= 10 # evaluate the training process after number of iterations
#n_samples= 500 # how many data samples should be used during training
learning_rate= 0.1 # learning rate
n_epoch=20
class Model:
......@@ -80,10 +81,11 @@ class Model:
@param data: matrix that contains 100 features and 1 label
'''
random.shuffle(data)
for epoch in range(0,1):
for epoch in range(0,n_epoch):
random.shuffle(data)
outputs=[]
error=0
......@@ -97,7 +99,7 @@ class Model:
x=np.reshape(x, [784,1]) #bring the features into right shape
zeros=np.zeros(shape=[N_OUTPUT,1])
zeros[label]=1
zeros[int(label)]=1
y=zeros
z_=[] # storage of neurons values before activation
......@@ -148,7 +150,7 @@ class Model:
if __name__ == "__main__":
data=get_mnist_data()
data=get_mnist_data(n_samples=5000)
model=Model()
model.train(data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment