Skip to content

IgorBasov/exp-lenet5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeNet5 (PyTorch): MNIST dataset

Another attempt to implement Yann LeCun's LeNet-5 network using PyTorch and test it in MNIST dataset.

Run experiment

  1. Install torch and torchvision libs

  2. Configure experiment in main.py file. Do not forget to set proper values to DATA_PATH (absolute path to data/datasets/ folder) and MODEL_STORE_PATH (absolute path to data/models/ folder) variables!

  3. Run

python main.py

Description

Files

  • lenet5.py - contains LeNet5 class that implements LeNet-5 network
  • lenet5_trainer.py - contains LeNet5Trainer class. Method train(train_data, learning_rate, num_epochs, print_every=100) trains the network and returns it after.
  • net_test.py - contains NetTest class. Method test(test_data) performs testing of the network and returns quantity of correct tests and total quantity of tests.
  • utils.py - contains method prepare_mnist_data(data_path, batch_size) that prepares data for the experiment.
  • main.py - main file of the experiment.

Folders

  • data/datasets/ - MNIST-dataset will be downloaded here (at first run).
  • data/models/ - folder to save files of trained models.

Remarks

  • I'm new in Python, so be lenient ;)
  • The network implementation is very rough, so be very lenient ;)

About

Experiment: LeNet-5 (MNIST) using PyTorch

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages