-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathNeuralNetPhiR.py
More file actions
29 lines (20 loc) · 934 Bytes
/
Copy pathNeuralNetPhiR.py
File metadata and controls
29 lines (20 loc) · 934 Bytes
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
from NeuralNet import NeuralNet
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten, BatchNormalization
from keras.layers import Conv2D, MaxPooling2D
from keras import backend
class NeuralNetPhiR(NeuralNet):
def beginTraining(self):
self.setTrainingParameters(200000, 1000, 128, 40)
def defineModel(self, inputShape : tuple, outputSize : int):
model = Sequential()
model.add(Dense(1024, activation='relu', input_shape=inputShape))
model.add(Dense(512, activation='relu'))
model.add(Dense(256, activation='relu'))
model.add(Dense(256, activation='relu'))
model.add(Dense(128, activation='relu'))
model.add(Dense(128, activation='relu'))
model.add(Dense(64, activation='relu'))
model.add(Dense(outputSize, activation='linear'))
return model