A GPU implementation of Biological Learning. This is a fork from this repo by D. Krotov and J. Hopfield.
MNIST | CIFAR-10 | Real/Fake Faces |
-
Unsupervised_learning_algorithm_MNIST.ipynb: Compares the BIO algorithm with backprop (BP) model on the MNIST dataset for digit recognition.
-
CIFAR-10, + gpu implementation for bio-unsupervised.ipynb: A comparison between BIO and BP models for object classification on CIFAR-10 dataset.
-
Face detection.ipynb: Real/Fake Face classification.
-
Unsupervised learning on Face (Gender, Ethicity): Gender and ethnicity classification.
We create a conda environment using environment.yml
. Feel free to change the package versions. To install the environment:
conda env create -f environment.yml
conda env list
conda activate hebbian
Note: To get the best of GPU functionalities, you should have a cuda-compatible gpu. Please change the cudatoolkit
, tensorflow
, and pytorch
versions to match your GPU settings.
To run any of the notebooks, simply run:
jupyter notebook [NOTEBOOK NAME]
N_hid | BIO Validation Accuracy | BP Validation Accuracy |
---|---|---|
200 | 95.7 | 97.9 |
500 | 96.5 | 97.9 |
1000 | 97.2 | 98.1 |
2000 | 97.8 | 98.15 |
4000 | 98.1 | 98.29 |
8000 | 98.1 | 98.3 |
BIO vs. BP Accuracies for MNIST | BIO Weights Visualization |
N_hid | BIO Validation Accuracy | BP Validation Accuracy |
---|---|---|
1000 | 46.5 | 54.2 |
2000 | 49.0 | 54.2 |
4000 | 50.3 | 54.6 |
8000 | 52.0 | 55.0 |
BIO vs. BP Accuracies for CIFAR | BIO Weights Visualization |
Example of "biological" learning for MNIST based on the paper Unsupervised Learning by Competing Hidden Units by D.Krotov and J.Hopfield. If you want to learn more about this work you can also check out this lecture from MIT's 6.S191 course.
(c) 2018 Dmitry Krotov -- Apache 2.0 License
This fork is the work of Yana Kuznetcov and Amin Heydarshahi and was initially developed as the course project for the graduate class Computational Visual Perception, instructed and supervised by Prof. Dr. Bernhard Egger and Dr. Patrick Krauß.