You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Short description of the content. Full codes you can find inside the course by link above:
9
12
10
13
*[Loading Data](#loading-data)
11
14
*[Unique Training Examples](#unique-examples)
@@ -26,7 +29,7 @@ Theory and experimental results (on this page):
26
29
<br/>
27
30
28
31
### <aid="loading-data">Loading Data</a>
29
-
Data used for this task is **German Traffic Sign Benchmarks (GTSB)**.
32
+
Data used for this task is **German Traffic Sign Benchmarks (GTSRB)**.
30
33
<br/>Initially dataset consists of images in ***PPM*** format with different sizes.
31
34
32
35
For current task datasets were organized in the same way as it was done for [CIFAR-10 Image Classification](https://github.com/sichkar-valentyn/Neural_Networks_for_Computer_Vision/blob/master/Theory/cifar10.md):
@@ -158,8 +161,6 @@ Shapes of data4 - data8 are as following (Gray):
158
161
For **Model 1** architecture will be used as it was done for [CIFAR-10 Image Classification](https://github.com/sichkar-valentyn/Neural_Networks_for_Computer_Vision/blob/master/Theory/cifar10.md):
<br/>For **Model 1** following parameters will be used:
164
165
165
166
| Parameter | Description |
@@ -175,52 +176,6 @@ For **Model 1** architecture will be used as it was done for [CIFAR-10 Image Cla
175
176
176
177
### <aid="overfitting-small-data-for-model-1">Overfitting Small Data for Model 1</a>
177
178
For Overfitting Small Data of Model 1 dataset **'data8.pickle'** was chosen.
178
-
<br>Code for Overfitting Small Data for Model 1 will be used as it was done for [CIFAR-10 Image Classification](https://github.com/sichkar-valentyn/Neural_Networks_for_Computer_Vision/blob/master/Theory/cifar10.md):
179
-
180
-
```py
181
-
import numpy as np
182
-
183
-
# Importing module 'ConvNet1.py'
184
-
from Helper_Functions.ConvNet1 import*
185
-
186
-
# Importing module 'Solver.py'
187
-
from Solver import*
188
-
189
-
# Loading data
190
-
# Opening file for reading in binary mode
191
-
withopen('Data_Preprocessing/data8.pickle', 'rb') as f:
192
-
d = pickle.load(f, encoding='latin1') # dictionary type
193
-
194
-
# Number of training examples
195
-
number_of_training_data =10
196
-
197
-
# Preparing data by slicing in 'data' dictionary appropriate array
198
-
small_data = {
199
-
'x_train':d['x_train'][:number_of_training_data],
200
-
'y_train':d['y_train'][:number_of_training_data],
201
-
'x_validation':d['x_validation'],
202
-
'y_validation':d['y_validation']
203
-
}
204
-
205
-
# Creating instance of class for 'ConvNet1' and initializing model
206
-
model = ConvNet1(weight_scale=1e-2, hidden_dimension=100)
207
-
208
-
# Creating instance of class for 'Solver' and initializing model
209
-
solver = Solver(model,
210
-
small_data,
211
-
update_rule='adam',
212
-
optimization_config={'learning_rate':1e-3},
213
-
learning_rate_decay=1.0,
214
-
batch_size=50,
215
-
number_of_epochs=100,
216
-
print_every=1,
217
-
verbose_mode=True
218
-
)
219
-
220
-
# Running training process
221
-
solver.train()
222
-
```
223
-
224
179
Overfitting Small Data with 10 training examples and 100 epochs is shown on the figure below.
@@ -229,41 +184,6 @@ Overfitting Small Data with 10 training examples and 100 epochs is shown on the
229
184
230
185
### <aid="training-of-model-1">Training of Model 1</a>
231
186
For training Model 1 dataset **'data8.pickle'** was chosen as it reached the best accuracy over all datasets.
232
-
<br>Code for training Model 1 will be used as it was done for [CIFAR-10 Image Classification](https://github.com/sichkar-valentyn/Neural_Networks_for_Computer_Vision/blob/master/Theory/cifar10.md):
233
-
234
-
```py
235
-
import numpy as np
236
-
237
-
# Importing module 'ConvNet1.py'
238
-
from Helper_Functions.ConvNet1 import*
239
-
240
-
# Importing module 'Solver.py'
241
-
from Solver import*
242
-
243
-
# Loading data
244
-
# Opening file for reading in binary mode
245
-
withopen('Data_Preprocessing/data8.pickle', 'rb') as f:
246
-
d = pickle.load(f, encoding='latin1') # dictionary type
247
-
248
-
# Creating instance of class for 'ConvNet1' and initializing model
249
-
model = ConvNet1(input_dimension=(1, 32, 32), weight_scale=1e-3, hidden_dimension=500, regularization=1-e3)
250
-
251
-
# Creating instance of class for 'Solver' and initializing model
252
-
solver = Solver(model,
253
-
d,
254
-
update_rule='adam',
255
-
optimization_config={'learning_rate':1e-3},
256
-
learning_rate_decay=1.0,
257
-
batch_size=50,
258
-
number_of_epochs=50,
259
-
print_every=1,
260
-
verbose_mode=True
261
-
)
262
-
263
-
# Running training process
264
-
solver.train()
265
-
```
266
-
267
187
Model 1 with 'data8.pickle' dataset reached **0.989** training accuracy.
268
188
<br/>Training process of Model 1 with **17 500** iterations is shown on the figure below.
0 commit comments