aboutsummaryrefslogtreecommitdiff
path: root/lenet.py
diff options
context:
space:
mode:
authorVasil Zlatanov <vasil@netcraft.com>2019-03-07 00:17:41 +0000
committerVasil Zlatanov <vasil@netcraft.com>2019-03-07 00:17:46 +0000
commitb878862fbf449178fe314d31c03c615433c17f5d (patch)
tree58f32a0b46953475335eb81169c445e080f081f6 /lenet.py
parent06b3e7c9fdae1f86e33f331b5f69cf326afb38e1 (diff)
downloade4-gan-b878862fbf449178fe314d31c03c615433c17f5d.tar.gz
e4-gan-b878862fbf449178fe314d31c03c615433c17f5d.tar.bz2
e4-gan-b878862fbf449178fe314d31c03c615433c17f5d.zip
Add get_lenet_icp
Diffstat (limited to 'lenet.py')
-rw-r--r--lenet.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/lenet.py b/lenet.py
index 97479ed..71b1c9e 100644
--- a/lenet.py
+++ b/lenet.py
@@ -57,7 +57,7 @@ def get_lenet(shape):
model = keras.Sequential()
model.add(Conv2D(filters=6, kernel_size=(3, 3), activation='relu', input_shape=shape))
model.add(AveragePooling2D())
-
+
model.add(Conv2D(filters=16, kernel_size=(3, 3), activation='relu'))
model.add(AveragePooling2D())
model.add(Flatten())
@@ -68,6 +68,20 @@ def get_lenet(shape):
model.add(Dense(units=10, activation = 'relu'))
return model
+def get_lenet_icp(shape):
+ model = keras.Sequential()
+ model.add(Conv2D(filters=6, kernel_size=(3, 3), activation='relu', input_shape=(32,32,1)))
+ model.add(AveragePooling2D())
+
+ model.add(Conv2D(filters=16, kernel_size=(3, 3), activation='relu'))
+ model.add(AveragePooling2D())
+ model.add(Flatten())
+
+ model.add(Dense(units=120, activation='relu'))
+ model.add(Dense(units=84, activation='relu'))
+ model.add(Dense(units=10, activation = 'relu'))
+ return model
+
def plot_history(history, metric = None):
# Plots the loss history of training and validation (if existing)
# and a given metric