Replication of some chapter 5 results

Author

Kim Young Jin

Published

July 1, 2024

import matplotlib.pyplot as plt
import mnist_loader  # noqa
import torch
import random
import torch.nn as nn  # noqa
import network2
training_data, validation_data, test_data = mnist_loader.load_data_wrapper()
training_data = list(training_data)
validation_data = list(validation_data)
test_data = list(test_data)
net = network2.Network([784, 30, 10])
net.SGD(
    training_data=training_data,
    epochs=30,
    mini_batch_size=10,
    eta=0.1,
    lmbda=5.0,
    evaluation_data=validation_data,
    monitor_evaluation_accuracy=True,
)
Epoch 0 training complete
Accuracy on evaluation data: 9325 / 10000
Epoch 1 training complete
Accuracy on evaluation data: 9471 / 10000
Epoch 2 training complete
Accuracy on evaluation data: 9499 / 10000
KeyboardInterrupt: