diff --git a/labworks/LW1/NN1.png b/labworks/LW1/NN1.png new file mode 100644 index 0000000..faa6ab4 Binary files /dev/null and b/labworks/LW1/NN1.png differ diff --git a/labworks/LW1/NN2.png b/labworks/LW1/NN2.png new file mode 100644 index 0000000..abbe788 Binary files /dev/null and b/labworks/LW1/NN2.png differ diff --git a/labworks/LW1/NN3.png b/labworks/LW1/NN3.png new file mode 100644 index 0000000..77da45f Binary files /dev/null and b/labworks/LW1/NN3.png differ diff --git a/labworks/LW1/NN4.png b/labworks/LW1/NN4.png new file mode 100644 index 0000000..1484d3a Binary files /dev/null and b/labworks/LW1/NN4.png differ diff --git a/labworks/LW1/NN5.png b/labworks/LW1/NN5.png new file mode 100644 index 0000000..fb78dce Binary files /dev/null and b/labworks/LW1/NN5.png differ diff --git a/labworks/LW1/NN6.png b/labworks/LW1/NN6.png new file mode 100644 index 0000000..2498ac1 Binary files /dev/null and b/labworks/LW1/NN6.png differ diff --git a/labworks/LW1/report.md b/labworks/LW1/report.md index ae7715d..bff855d 100644 --- a/labworks/LW1/report.md +++ b/labworks/LW1/report.md @@ -111,17 +111,7 @@ model_p.compile(loss='categorical_crossentropy', optimizer='sgd', metrics=['accu ``` model_p.summary() ``` - -> Model: "sequential" -> ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓ -> ┃ Layer (type) ┃ Output Shape ┃ Param # ┃ -> ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩ -> │ dense (Dense) │ (None, 10) │ 7,850 │ -> └─────────────────────────────────┴────────────────────────┴───────────────┘ -> Total params: 7,852 (30.68 KB) -> Trainable params: 7,850 (30.66 KB) -> Non-trainable params: 0 (0.00 B) -> Optimizer params: 2 (12.00 B) +![Архитектура](NN1.png) * Обучил модель ``` @@ -164,17 +154,7 @@ model_2l_100.summary() ``` ->Model: "sequential" ->┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓ ->┃ Layer (type) ┃ Output Shape ┃ Param # ┃ ->┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩ ->│ dense_34 (Dense) │ (None, 100) │ 78,500 │ ->├─────────────────────────────────┼────────────────────────┼───────────────┤ ->│ dense_35 (Dense) │ (None, 10) │ 1,010 │ ->└─────────────────────────────────┴────────────────────────┴───────────────┘ -> Total params: 79,510 (310.59 KB) -> Trainable params: 79,510 (310.59 KB) -> Non-trainable params: 0 (0.00 B) +![Архитектура](NN2.png) * Обучили модель ``` @@ -216,17 +196,7 @@ model_2l_300.summary() ``` ->Model: "sequential_5" ->┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓ ->┃ Layer (type) ┃ Output Shape ┃ Param # ┃ ->┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩ ->│ dense_9 (Dense) │ (None, 300) │ 235,500 │ ->├─────────────────────────────────┼────────────────────────┼───────────────┤ ->│ dense_10 (Dense) │ (None, 10) │ 3,010 │ ->└─────────────────────────────────┴────────────────────────┴───────────────┘ -> Total params: 238,510 (931.68 KB) -> Trainable params: 238,510 (931.68 KB) -> Non-trainable params: 0 (0.00 B) +![Архитектура](NN3.png) * Обучили модель ``` @@ -267,18 +237,7 @@ model_2l_500.compile(loss='categorical_crossentropy', optimizer='sgd', metrics=[ model_2l_500.summary() ``` -> Архитектура нейронной сети: ->Model: "sequential_6" ->┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓ ->┃ Layer (type) ┃ Output Shape ┃ Param # ┃ ->┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩ ->│ dense_24 (Dense) │ (None, 500) │ 392,500 │ ->├─────────────────────────────────┼────────────────────────┼───────────────┤ ->│ dense_25 (Dense) │ (None, 10) │ 5,010 │ ->└─────────────────────────────────┴────────────────────────┴───────────────┘ -> Total params: 397,510 (1.52 MB) -> Trainable params: 397,510 (1.52 MB) -> Non-trainable params: 0 (0.00 B) +![Архитектура](NN4.png) * Обучаем модель ``` @@ -323,19 +282,7 @@ model_3l_100_50.compile(loss='categorical_crossentropy', optimizer='sgd', metric model_3l_100_50.summary() ``` ->Model: "sequential_7" ->┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓ ->┃ Layer (type) ┃ Output Shape ┃ Param # ┃ ->┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩ ->│ dense_13 (Dense) │ (None, 100) │ 78,500 │ ->├─────────────────────────────────┼────────────────────────┼───────────────┤ ->│ dense_14 (Dense) │ (None, 50) │ 5,050 │ ->├─────────────────────────────────┼────────────────────────┼───────────────┤ ->│ dense_15 (Dense) │ (None, 10) │ 510 │ ->└─────────────────────────────────┴────────────────────────┴───────────────┘ -> Total params: 84,060 (328.36 KB) -> Trainable params: 84,060 (328.36 KB) -> Non-trainable params: 0 (0.00 B) +![Архитектура](NN5.png) * Обучили модель ``` @@ -377,19 +324,7 @@ model_3l_100_100.summary() ``` ->Model: "sequential_2" ->┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓ ->┃ Layer (type) ┃ Output Shape ┃ Param # ┃ ->┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩ ->│ dense_3 (Dense) │ (None, 100) │ 78,500 │ ->├─────────────────────────────────┼────────────────────────┼───────────────┤ ->│ dense_4 (Dense) │ (None, 100) │ 10,100 │ ->├─────────────────────────────────┼────────────────────────┼───────────────┤ ->│ dense_5 (Dense) │ (None, 10) │ 1,010 │ ->└─────────────────────────────────┴────────────────────────┴───────────────┘ -> Total params: 89,610 (350.04 KB) -> Trainable params: 89,610 (350.04 KB) -> Non-trainable params: 0 (0.00 B) ' +![Архитектура](NN6.png) * Обучили модель ``` @@ -420,14 +355,14 @@ print('Accuracy on test data:',scores[1]) >Loss on test data: 0.35140201449394226 >Accuracy on test data: 0.9049000144004822 -Количество Количество нейронов в Количество нейронов во Значение метрики -скрытых слоев первом скрытом слое втором скрытом слое качества классификации -0 - - 0.9151999950408936 -1 100 - 0.9154999852180481 -1 300 - 0.9139000177383423 -1 500 - 0.9122999906539917 -2 100 50 0.9021999835968018 -2 100 100 0.9049000144004822 +| Кол-во слоёв | Нейронов в 1-м | Нейронов во 2-м | Accuracy | +|---------------|----------------|-----------------|-----| +| 0 | – | – | 0.9151999950408936 | +| 1 | 100 | – | 0.9154999852180481 | +| 1 | 300 | – | 0.9139000177383423 | +| 1 | 500 | – | 0.9122999906539917 | +| 2 | 100 | 50 | 0.9021999835968018 | +| 2 | 100 | 100 | 0.9049000144004822 | По значениям метрики качества классификации можно увидеть, что лучше всего справилась двухслойная сеть с 100 нейронами в скрытом слое. Наращивание кол-во слоев и кол-во нейронов в них не привели к желаемому росту значения метрики качества, а наоборот ухудшили ее. Вероятно связано это с тем, что для более мощных архитектур нужно увеличить обучающую выборку, чем есть сейчас у нас, иначе это приводит к переобучению сети.