-
Notifications
You must be signed in to change notification settings - Fork 99
/
LeNet.py
27 lines (22 loc) · 804 Bytes
/
LeNet.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
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from convnet_drawer import Model, Conv2D, MaxPooling2D, Flatten, Dense
from pptx_util import save_model_to_pptx
import config
def main():
config.inter_layer_margin = 65
config.channel_scale = 4 / 5
model = Model(input_shape=(32, 32, 1))
model.add(Conv2D(6, (5, 5), (1, 1)))
model.add(MaxPooling2D((2, 2)))
model.add(Conv2D(16, (5, 5)))
model.add(MaxPooling2D((2, 2)))
model.add(Flatten())
model.add(Dense(120))
model.add(Dense(84))
model.add(Dense(10))
model.save_fig(os.path.splitext(os.path.basename(__file__))[0] + ".svg")
save_model_to_pptx(model, os.path.splitext(os.path.basename(__file__))[0] + ".pptx")
if __name__ == '__main__':
main()