-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdriver.py
executable file
·33 lines (24 loc) · 924 Bytes
/
driver.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
#!/bin/python3
# import NeuralNet
from NeuralNet.NeuralNetwork import NeuralNetwork
from NeuralNet.utils import loadMNIST, flatten, ohe, computeLoss, oneHotDecoding
# Importing Dataset and Splitting it
# (train_img, train_labels), (test_img, test_labels) = loadMNIST()
# Data Processing
# training_images = flatten(train_img, normalize = True)
# training_labels = ohe(train_labels, 10)
# Problem specific Parameters
# num_classes = 10
# input_shape = (784, 1)
input_shape = (3, 1)
num_classes = 1
# Defining Model Parameters
layers = (input_shape[0], 2, num_classes)
activations = ('leakyrelu', 'tanh', 'sigmoid')
loss = 'rmse'
optimizer = 'sgd'
# Creating the model
nn = NeuralNetwork(layers = layers, activations = activations, loss = loss, optimizer = optimizer)
# nn.train(training_images, training_labels, epochs = 2, batchsize = 17)
# label = training_labels[0]
# prediction = nn.predict(training_images[0])