-
Notifications
You must be signed in to change notification settings - Fork 15
/
model.py
51 lines (40 loc) · 2.03 KB
/
model.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
47
48
49
50
51
from keras import layers
from keras import models
from keras import optimizers
class Model():
def __init__(self, shape):
self.model = models.Sequential()
self.model.add(layers.Conv2D(16, (3,3), activation='relu', input_shape=shape))
self.model.add(layers.Conv2D(16, (3,3), activation='relu'))
self.model.add(layers.MaxPooling2D((2, 2)))
self.model.add(layers.Conv2D(32, (3,3), activation='relu'))
self.model.add(layers.Conv2D(32, (3,3), activation='relu'))
self.model.add(layers.MaxPooling2D((2, 2)))
self.model.add(layers.Flatten())
self.model.add(layers.Dense(256, activation='relu'))
self.model.add(layers.Dense(1, activation='sigmoid'))
class Model10():
def __init__(self, shape):
self.model = models.Sequential()
self.model.add(layers.Conv2D(16, (3,3), activation='relu', input_shape=shape))
self.model.add(layers.Conv2D(16, (3,3), activation='relu'))
self.model.add(layers.Conv2D(32, (3,3), activation='relu'))
self.model.add(layers.Conv2D(32, (3,3), activation='relu'))
self.model.add(layers.Flatten())
self.model.add(layers.Dense(256, activation='relu'))
self.model.add(layers.Dense(1, activation='sigmoid'))
class Model8():
def __init__(self, shape):
self.model = models.Sequential()
self.model.add(layers.Conv2D(16, (3,3), activation='relu', input_shape=shape))
self.model.add(layers.Conv2D(16, (3,3), activation='relu'))
self.model.add(layers.Flatten())
self.model.add(layers.Dense(256, activation='relu'))
self.model.add(layers.Dense(1, activation='sigmoid'))
class Model4():
def __init__(self, shape):
self.model = models.Sequential()
self.model.add(layers.Conv2D(16, (3,3), activation='relu', input_shape=shape))
self.model.add(layers.Flatten())
self.model.add(layers.Dense(256, activation='relu'))
self.model.add(layers.Dense(1, activation='sigmoid'))