Requirement already satisfied: tensorflow in /shared-libs/python3.9/py/lib/python3.9/site-packages (2.10.0)
Requirement already satisfied: astunparse>=1.6.0 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (1.6.3)
Requirement already satisfied: h5py>=2.9.0 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (3.7.0)
Requirement already satisfied: tensorflow-estimator<2.11,>=2.10.0 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (2.10.0)
Requirement already satisfied: opt-einsum>=2.3.2 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (3.3.0)
Requirement already satisfied: libclang>=13.0.0 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (14.0.6)
Requirement already satisfied: protobuf<3.20,>=3.9.2 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (3.19.6)
Requirement already satisfied: keras-preprocessing>=1.1.1 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (1.1.2)
Requirement already satisfied: wrapt>=1.11.0 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (1.14.1)
Requirement already satisfied: tensorboard<2.11,>=2.10 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (2.10.1)
Requirement already satisfied: termcolor>=1.1.0 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (2.0.1)
Requirement already satisfied: grpcio<2.0,>=1.24.3 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (1.50.0)
Requirement already satisfied: google-pasta>=0.1.1 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (0.2.0)
Requirement already satisfied: tensorflow-io-gcs-filesystem>=0.23.1 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (0.27.0)
Requirement already satisfied: absl-py>=1.0.0 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (1.3.0)
Requirement already satisfied: typing-extensions>=3.6.6 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (4.4.0)
Requirement already satisfied: six>=1.12.0 in /shared-libs/python3.9/py-core/lib/python3.9/site-packages (from tensorflow) (1.16.0)
Requirement already satisfied: flatbuffers>=2.0 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (22.9.24)
Requirement already satisfied: gast<=0.4.0,>=0.2.1 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (0.4.0)
Requirement already satisfied: setuptools in /root/venv/lib/python3.9/site-packages (from tensorflow) (58.1.0)
Requirement already satisfied: keras<2.11,>=2.10.0 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (2.10.0)
Requirement already satisfied: packaging in /shared-libs/python3.9/py-core/lib/python3.9/site-packages (from tensorflow) (21.3)
Requirement already satisfied: numpy>=1.20 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorflow) (1.23.4)
Requirement already satisfied: wheel<1.0,>=0.23.0 in /usr/local/lib/python3.9/site-packages (from astunparse>=1.6.0->tensorflow) (0.38.4)
Requirement already satisfied: requests<3,>=2.21.0 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorboard<2.11,>=2.10->tensorflow) (2.28.1)
Requirement already satisfied: google-auth<3,>=1.6.3 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorboard<2.11,>=2.10->tensorflow) (2.13.0)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorboard<2.11,>=2.10->tensorflow) (1.8.1)
Requirement already satisfied: markdown>=2.6.8 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorboard<2.11,>=2.10->tensorflow) (3.4.1)
Requirement already satisfied: werkzeug>=1.0.1 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorboard<2.11,>=2.10->tensorflow) (2.2.2)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorboard<2.11,>=2.10->tensorflow) (0.4.6)
Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from tensorboard<2.11,>=2.10->tensorflow) (0.6.1)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /shared-libs/python3.9/py-core/lib/python3.9/site-packages (from packaging->tensorflow) (3.0.9)
Requirement already satisfied: rsa<5,>=3.1.4 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from google-auth<3,>=1.6.3->tensorboard<2.11,>=2.10->tensorflow) (4.9)
Requirement already satisfied: cachetools<6.0,>=2.0.0 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from google-auth<3,>=1.6.3->tensorboard<2.11,>=2.10->tensorflow) (5.2.0)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from google-auth<3,>=1.6.3->tensorboard<2.11,>=2.10->tensorflow) (0.2.8)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.11,>=2.10->tensorflow) (1.3.1)
Requirement already satisfied: importlib-metadata>=4.4 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from markdown>=2.6.8->tensorboard<2.11,>=2.10->tensorflow) (5.0.0)
Requirement already satisfied: charset-normalizer<3,>=2 in /shared-libs/python3.9/py-core/lib/python3.9/site-packages (from requests<3,>=2.21.0->tensorboard<2.11,>=2.10->tensorflow) (2.1.1)
Requirement already satisfied: idna<4,>=2.5 in /shared-libs/python3.9/py-core/lib/python3.9/site-packages (from requests<3,>=2.21.0->tensorboard<2.11,>=2.10->tensorflow) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from requests<3,>=2.21.0->tensorboard<2.11,>=2.10->tensorflow) (1.26.12)
Requirement already satisfied: certifi>=2017.4.17 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from requests<3,>=2.21.0->tensorboard<2.11,>=2.10->tensorflow) (2022.9.24)
Collecting MarkupSafe>=2.1.1
Downloading MarkupSafe-2.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Requirement already satisfied: zipp>=0.5 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<2.11,>=2.10->tensorflow) (3.9.0)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard<2.11,>=2.10->tensorflow) (0.4.8)
Requirement already satisfied: oauthlib>=3.0.0 in /shared-libs/python3.9/py/lib/python3.9/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.11,>=2.10->tensorflow) (3.2.2)
Installing collected packages: MarkupSafe
Attempting uninstall: MarkupSafe
Found existing installation: MarkupSafe 2.0.0
Uninstalling MarkupSafe-2.0.0:
ERROR: Could not install packages due to an OSError: [Errno 30] Read-only file system: 'RECORD'
WARNING: You are using pip version 22.0.4; however, version 23.0.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
Note: you may need to restart the kernel to use updated packages.
2023-03-07 13:30:26.000812: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F AVX512_VNNI FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-03-07 13:30:26.109776: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2023-03-07 13:30:26.114569: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2023-03-07 13:30:26.114586: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2023-03-07 13:30:26.137535: E tensorflow/stream_executor/cuda/cuda_blas.cc:2981] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2023-03-07 13:30:27.226029: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory
2023-03-07 13:30:27.226094: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory
2023-03-07 13:30:27.226100: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz
11490434/11490434 [==============================] - 0s 0us/step
2023-03-07 13:30:30.058612: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2023-03-07 13:30:30.058638: W tensorflow/stream_executor/cuda/cuda_driver.cc:263] failed call to cuInit: UNKNOWN ERROR (303)
2023-03-07 13:30:30.058655: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (p-0bcb5037-7896-4986-8c84-c266f675c40f): /proc/driver/nvidia/version does not exist
2023-03-07 13:30:30.058874: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F AVX512_VNNI FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Epoch 1/10
469/469 [==============================] - 1s 2ms/step - loss: 0.4720 - accuracy: 0.8646 - val_loss: 0.2565 - val_accuracy: 0.9255
Epoch 2/10
469/469 [==============================] - 1s 1ms/step - loss: 0.2308 - accuracy: 0.9332 - val_loss: 0.2000 - val_accuracy: 0.9419
Epoch 3/10
469/469 [==============================] - 1s 1ms/step - loss: 0.1816 - accuracy: 0.9478 - val_loss: 0.1685 - val_accuracy: 0.9501
Epoch 4/10
469/469 [==============================] - 1s 1ms/step - loss: 0.1496 - accuracy: 0.9568 - val_loss: 0.1381 - val_accuracy: 0.9574
Epoch 5/10
469/469 [==============================] - 1s 1ms/step - loss: 0.1267 - accuracy: 0.9627 - val_loss: 0.1326 - val_accuracy: 0.9598
Epoch 6/10
469/469 [==============================] - 1s 1ms/step - loss: 0.1103 - accuracy: 0.9676 - val_loss: 0.1157 - val_accuracy: 0.9635
Epoch 7/10
469/469 [==============================] - 1s 1ms/step - loss: 0.0965 - accuracy: 0.9717 - val_loss: 0.1050 - val_accuracy: 0.9681
Epoch 8/10
469/469 [==============================] - 1s 1ms/step - loss: 0.0858 - accuracy: 0.9748 - val_loss: 0.1011 - val_accuracy: 0.9692
Epoch 9/10
469/469 [==============================] - 1s 1ms/step - loss: 0.0772 - accuracy: 0.9777 - val_loss: 0.1099 - val_accuracy: 0.9668
Epoch 10/10
469/469 [==============================] - 1s 1ms/step - loss: 0.0704 - accuracy: 0.9787 - val_loss: 0.1011 - val_accuracy: 0.9689
Test loss: 0.10106973350048065, Test accuracy 0.9689000248908997
Question 2
Model: "sequential"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
flatten (Flatten) (None, 784) 0
dense (Dense) (None, 64) 50240
dense_1 (Dense) (None, 64) 4160
dense_2 (Dense) (None, 10) 650
=================================================================
Total params: 55,050
Trainable params: 55,050
Non-trainable params: 0
_________________________________________________________________
2.1)
From the summary we can see that our model has four layers. One input layer (flatten) two hidden layers and one output layer that represents the numbers 0-9. It also shows how many neurons each layer has: the first one has 784 since it represents all the pixels in the 28 x 28 original image. The two hidden layers have 64 neurons each and the output layer has 10 neurons, one for each number. The number of neurons in the hidden layers can vary based what generates the optimal result. We also see that the toatal numbers of parameters are 55 050.
Most layers use the Rectified Linear Unit (ReLu) activation funciton. The ReLu is commonly used in neural such as this one because it computationally efficient becuase it doesnt use any advanced mathematical formula making it faster than other methods. Furthermore, it prevents a problem with vanishing gradients, for example when the sigmoid funciton gets close to 0 or 1. This could make it hard for model to learn when the gradient becomes small. The outout function uses softmax as activation. This, as opposed to the ReLu activation, creates a probalility distribution over the classification that together sum up to one. It then activates the node with the highest probability which is our output.
2.2)
The loss function used is categorical crossentropy. This is commonly used for these kinds of multidimensional where each sample only belong to one class. The model measures the dissimilarity between probability distributions and helps the model learn to predict the correct class labels. The formula is calculated as the negative sum over all classes i, from 1 to the total number of classes, of the product of the true label for that class and the logarithm of the predicted probability for that class.
2.3)
Epoch 1/10
/shared-libs/python3.9/py/lib/python3.9/site-packages/keras/optimizers/optimizer_v2/gradient_descent.py:111: UserWarning: The `lr` argument is deprecated, use `learning_rate` instead.
super().__init__(name, **kwargs)
469/469 [==============================] - 1s 2ms/step - loss: 0.4935 - accuracy: 0.8570 - val_loss: 0.2528 - val_accuracy: 0.9265
Epoch 2/10
469/469 [==============================] - 1s 1ms/step - loss: 0.2356 - accuracy: 0.9312 - val_loss: 0.1970 - val_accuracy: 0.9405
Epoch 3/10
469/469 [==============================] - 1s 1ms/step - loss: 0.1797 - accuracy: 0.9476 - val_loss: 0.1666 - val_accuracy: 0.9502
Epoch 4/10
469/469 [==============================] - 1s 1ms/step - loss: 0.1484 - accuracy: 0.9562 - val_loss: 0.1413 - val_accuracy: 0.9584
Epoch 5/10
469/469 [==============================] - 1s 1ms/step - loss: 0.1265 - accuracy: 0.9628 - val_loss: 0.1344 - val_accuracy: 0.9593
Epoch 6/10
469/469 [==============================] - 1s 1ms/step - loss: 0.1104 - accuracy: 0.9675 - val_loss: 0.1187 - val_accuracy: 0.9648
Epoch 7/10
469/469 [==============================] - 1s 1ms/step - loss: 0.0994 - accuracy: 0.9708 - val_loss: 0.1011 - val_accuracy: 0.9694
Epoch 8/10
469/469 [==============================] - 1s 1ms/step - loss: 0.0888 - accuracy: 0.9739 - val_loss: 0.1118 - val_accuracy: 0.9657
Epoch 9/10
469/469 [==============================] - 1s 1ms/step - loss: 0.0812 - accuracy: 0.9762 - val_loss: 0.0986 - val_accuracy: 0.9689
Epoch 10/10
469/469 [==============================] - 1s 1ms/step - loss: 0.0740 - accuracy: 0.9784 - val_loss: 0.0952 - val_accuracy: 0.9711
Test loss: 0.09520911425352097, Test accuracy 0.9710999727249146
2.4)
Test loss: 0.06493577361106873, Test accuracy 0.9825000166893005
1e-06
Test loss: 0.0642545074224472, Test accuracy 0.983299970626831
1e-06
Test loss: 0.06840655207633972, Test accuracy 0.98089998960495
1e-06
Test loss: 0.07332628965377808, Test accuracy 0.982699990272522
1e-05
Test loss: 0.07675454765558243, Test accuracy 0.9815999865531921
1e-05
Test loss: 0.0754057765007019, Test accuracy 0.982200026512146
1e-05
Test loss: 0.11756456643342972, Test accuracy 0.9832000136375427
0.0001
Test loss: 0.11975600570440292, Test accuracy 0.9811000227928162
0.0001
Test loss: 0.11955969035625458, Test accuracy 0.9821000099182129
0.0001
Test loss: 0.12910886108875275, Test accuracy 0.9758999943733215
0.0005
Test loss: 0.10776307433843613, Test accuracy 0.9828000068664551
0.0005
Test loss: 0.10895603895187378, Test accuracy 0.9812999963760376
0.0005
Test loss: 0.11710497736930847, Test accuracy 0.9824000000953674
0.001
Test loss: 0.12015015631914139, Test accuracy 0.98089998960495
0.001
Test loss: 0.1352846473455429, Test accuracy 0.9751999974250793
0.001
[[0.9825000166893005, 1e-06, 0], [0.983299970626831, 1e-06, 1], [0.98089998960495, 1e-06, 2], [0.982699990272522, 1e-05, 0], [0.9815999865531921, 1e-05, 1], [0.982200026512146, 1e-05, 2], [0.9832000136375427, 0.0001, 0], [0.9811000227928162, 0.0001, 1], [0.9821000099182129, 0.0001, 2], [0.9758999943733215, 0.0005, 0], [0.9828000068664551, 0.0005, 1], [0.9812999963760376, 0.0005, 2], [0.9824000000953674, 0.001, 0], [0.98089998960495, 0.001, 1], [0.9751999974250793, 0.001, 2]]
Max accuracy 0.9822333256403605
Comment on 2.4)
A max accuracy of 0.9822 was achieved. This was not the same as Hiltons result of 0.9847. The reason behind this could be the use of different epochs and regularization factors. There is no mention of the number of epochs Hinton used and higher number of epoch could, up to a certain point, result in a higher accuracy. The case could also be that a higher epoch than Hilton was used and thus overfitted the model, resulting in a lower accuracy. Either way, the diffrence in accuracy may be a cause of different number of epochs.
The regularization factor also have an effect on the accuracy. This was seen above where different factors generated different accuracy. Since Hilton only said to use five factors inside an interval, the factors picked could differ.
Question 3
3.1)
Epoch 1/20
469/469 [==============================] - 15s 30ms/step - loss: 0.3853 - accuracy: 0.8825 - val_loss: 0.0990 - val_accuracy: 0.9695
Epoch 2/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0842 - accuracy: 0.9738 - val_loss: 0.0670 - val_accuracy: 0.9783
Epoch 3/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0572 - accuracy: 0.9825 - val_loss: 0.0489 - val_accuracy: 0.9841
Epoch 4/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0431 - accuracy: 0.9862 - val_loss: 0.0386 - val_accuracy: 0.9888
Epoch 5/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0345 - accuracy: 0.9896 - val_loss: 0.0641 - val_accuracy: 0.9808
Epoch 6/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0290 - accuracy: 0.9914 - val_loss: 0.0353 - val_accuracy: 0.9882
Epoch 7/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0235 - accuracy: 0.9930 - val_loss: 0.0459 - val_accuracy: 0.9859
Epoch 8/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0204 - accuracy: 0.9936 - val_loss: 0.0327 - val_accuracy: 0.9897
Epoch 9/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0172 - accuracy: 0.9952 - val_loss: 0.0426 - val_accuracy: 0.9874
Epoch 10/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0140 - accuracy: 0.9960 - val_loss: 0.0344 - val_accuracy: 0.9892
Epoch 11/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0120 - accuracy: 0.9964 - val_loss: 0.0335 - val_accuracy: 0.9898
Epoch 12/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0105 - accuracy: 0.9973 - val_loss: 0.0292 - val_accuracy: 0.9913
Epoch 13/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0089 - accuracy: 0.9978 - val_loss: 0.0304 - val_accuracy: 0.9913
Epoch 14/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0069 - accuracy: 0.9986 - val_loss: 0.0306 - val_accuracy: 0.9913
Epoch 15/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0061 - accuracy: 0.9986 - val_loss: 0.0591 - val_accuracy: 0.9839
Epoch 16/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0051 - accuracy: 0.9989 - val_loss: 0.0335 - val_accuracy: 0.9909
Epoch 17/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0047 - accuracy: 0.9991 - val_loss: 0.0305 - val_accuracy: 0.9917
Epoch 18/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0036 - accuracy: 0.9995 - val_loss: 0.0331 - val_accuracy: 0.9913
Epoch 19/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0032 - accuracy: 0.9996 - val_loss: 0.0314 - val_accuracy: 0.9924
Epoch 20/20
469/469 [==============================] - 14s 30ms/step - loss: 0.0026 - accuracy: 0.9997 - val_loss: 0.0331 - val_accuracy: 0.9912
Test loss: 0.033051393926143646, Test accuracy 0.9911999702453613
Comment on 3.1)
When I first tried only using convolution I ended up with an accuracy of 0.986. Then I saw from the video that it is common to use MaxPooling together with convolutional layers. The MaxPooling divides the feature maps into smller subplots which makes the model more cumpotunally efficient and reduces the risk of overfitting. I then tested with MaxPooling and some different numbers of neurons and epochs and eventually got an accuracy of 0.9911 which is above 99 %
Video on MaxPooling2D: https://www.youtube.com/watch?v=WvoLTXIjBYU&list=PLQVvvaa0QuDfhTox0AjmQ6tvTgMBZBEXN&index=4&ab_channel=sentdex
3.2)
Convolutional layers and fully connected layers serve different purposes in machine learning models. Convolutional layers are designed to work better on images whereas fully connected layers works with every datatype.
Since the convolutional layers have fewer parameters which makes them less prone to overfittning, it is also better at detecting objects in images. For example a circle or line that makes up a number. The fully connected layer on the other hand are more efficient when it comes to data that is not structured as a imgaes with grids. This could be predicting the score of a game based on a set of features.
Since this task was an image classification task, convolutional layers worked better which also the report showed.