-
Notifications
You must be signed in to change notification settings - Fork 35
/
VGG16.ini
298 lines (255 loc) · 5.03 KB
/
VGG16.ini
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; (C) Copyright 2017 CEA LIST. All Rights Reserved.
; Contributor(s): David BRIAND (david.briand@cea.fr)
;
; This software is governed by the CeCILL-C license under French law and
; abiding by the rules of distribution of free software. You can use,
; modify and/ or redistribute the software under the terms of the CeCILL-C
; license as circulated by CEA, CNRS and INRIA at the following URL
; "http://www.cecill.info".
;
; As a counterpart to the access to the source code and rights to copy,
; modify and redistribute granted by the license, users are provided only
; with a limited warranty and the software's author, the holder of the
; economic rights, and the successive licensors have only limited
; liability.
;
; The fact that you are presently reading this means that you have had
; knowledge of the CeCILL-C license and that you accept its terms.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ./n2d2.sh "$N2D2_MODELS/VGG16.ini" -learn 200000000 -log 512000
; Resolution
$SIZE=224
; Margin for random cropping during learning
$MARGIN=32
; Training parameters
$LR=0.01
$WD=0.0005
$MOMENTUM=0.9
$BATCH_SIZE=16
$STEP_DECAY_EPOCHS=39
$STEP_DECAY_RATE=0.1
$EPOCHS=$(4 * ${STEP_DECAY_EPOCHS})
DefaultModel=Frame_CUDA
; Database
[database]
Type=ILSVRC2012_Database
RandomPartitioning=0
Learn=1.0
; Environment
[sp]
SizeX=${SIZE}
SizeY=${SIZE}
NbChannels=3
BatchSize=${BATCH_SIZE}
[sp.Transformation-1]
Type=RescaleTransformation
Width=$(${SIZE} + ${MARGIN})
Height=$(${SIZE} + ${MARGIN})
KeepAspectRatio=1
ResizeToFit=0
[sp.Transformation-2]
Type=PadCropTransformation
Width=$(${SIZE} + ${MARGIN})
Height=$(${SIZE} + ${MARGIN})
[sp.Transformation-3]
Type=ColorSpaceTransformation
ColorSpace=BGR
[sp.Transformation-4]
Type=RangeAffineTransformation
FirstOperator=Minus
FirstValue=104.0 117.0 124.0 ; BGR format, same as in Caffe
SecondOperator=Divides
SecondValue=255.0
[sp.OnTheFlyTransformation-1]
Type=SliceExtractionTransformation
ApplyTo=LearnOnly
Width=[sp]SizeX
Height=[sp]SizeY
RandomOffsetX=1
RandomOffsetY=1
[sp.OnTheFlyTransformation-2]
Type=SliceExtractionTransformation
ApplyTo=TestOnly
Width=[sp]SizeX
Height=[sp]SizeY
OffsetX=$(${MARGIN} // 2)
OffsetY=$(${MARGIN} // 2)
[sp.OnTheFlyTransformation-3]
Type=FlipTransformation
ApplyTo=LearnOnly
RandomHorizontalFlip=1
[conv_def]
Type=Conv
ActivationFunction=Rectifier
WeightsFiller=HeFiller
ConfigSection=common.config
[conv1_1] conv_def
Input=sp
KernelDims=3 3
NbOutputs=64
Stride=1
Padding=1
[conv1_2] conv_def
Input=conv1_1
KernelDims=3 3
NbOutputs=64
Stride=1
Padding=1
[pool1]
Input=conv1_2
Type=Pool
PoolDims=2 2
NbOutputs=[conv1_2]NbOutputs
Stride=2
Pooling=Max
Mapping.Size=1
[conv2_1] conv_def
Input=pool1
KernelDims=3 3
NbOutputs=128
Stride=1
Padding=1
[conv2_2] conv_def
Input=conv2_1
KernelDims=3 3
NbOutputs=128
Stride=1
Padding=1
[pool2]
Input=conv2_2
Type=Pool
PoolDims=2 2
NbOutputs=[conv2_2]NbOutputs
Stride=2
Pooling=Max
Mapping.Size=1
[conv3_1] conv_def
Input=pool2
KernelDims=3 3
NbOutputs=256
Stride=1
Padding=1
[conv3_2] conv_def
Input=conv3_1
KernelDims=3 3
NbOutputs=256
Stride=1
Padding=1
[conv3_3] conv_def
Input=conv3_2
KernelDims=3 3
NbOutputs=256
Stride=1
Padding=1
[pool3]
Input=conv3_3
Type=Pool
PoolDims=2 2
NbOutputs=[conv3_3]NbOutputs
Stride=2
Pooling=Max
Mapping.Size=1
[conv4_1] conv_def
Input=pool3
KernelDims=3 3
NbOutputs=512
Stride=1
Padding=1
[conv4_2] conv_def
Input=conv4_1
KernelDims=3 3
NbOutputs=512
Stride=1
Padding=1
[conv4_3] conv_def
Input=conv4_2
KernelDims=3 3
NbOutputs=512
Stride=1
Padding=1
[pool4]
Input=conv4_3
Type=Pool
PoolDims=2 2
NbOutputs=[conv4_3]NbOutputs
Stride=2
Pooling=Max
Mapping.Size=1
[conv5_1] conv_def
Input=pool4
KernelDims=3 3
NbOutputs=512
Stride=1
Padding=1
[conv5_2] conv_def
Input=conv5_1
KernelDims=3 3
NbOutputs=512
Stride=1
Padding=1
[conv5_3] conv_def
Input=conv5_2
KernelDims=3 3
NbOutputs=512
Stride=1
Padding=1
[pool5]
Input=conv5_3
Type=Pool
PoolDims=2 2
NbOutputs=[conv5_3]NbOutputs
Stride=2
Pooling=Max
Mapping.Size=1
[fc6]
Input=pool5
Type=Fc
NbOutputs=4096
ActivationFunction=Rectifier
WeightsFiller=HeFiller
ConfigSection=common.config
[fc6.drop]
Input=fc6
Type=Dropout
NbOutputs=[fc6]NbOutputs
ConfigSection=fc6.dropconfig
[fc6.dropconfig]
Dropout=0.5
[fc7]
Input=fc6.drop
Type=Fc
NbOutputs=4096
ActivationFunction=Rectifier
WeightsFiller=HeFiller
BiasFiller=ConstantFiller
[fc7.drop]
Input=fc7
Type=Dropout
NbOutputs=[fc7]NbOutputs
ConfigSection=fc7.dropconfig
[fc7.dropconfig]
Dropout=0.5
[fc8]
Input=fc7.drop
Type=Fc
NbOutputs=1000
ActivationFunction=Linear
WeightsFiller=XavierFiller
ConfigSection=common.config
[soft1]
Input=fc8
Type=Softmax
NbOutputs=[fc8]NbOutputs
WithLoss=1
[soft1.Target]
TopN=5
[common.config]
NoBias=1
Solvers.LearningRate=${LR}
Solvers.Decay=${WD}
Solvers.Momentum=${MOMENTUM}
Solvers.LearningRatePolicy=StepDecay
Solvers.LearningRateStepSize=$([sp]_EpochSize * ${STEP_DECAY_EPOCHS})
Solvers.LearningRateDecay=${STEPDECAY_RATE}
;Solvers.IterationSize=16