• Stars
    star
    345
  • Rank 122,750 (Top 3 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created almost 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This is a tutorial to connect the fundamental mathematics to a practical implementation addressing the continual learning problem of artificial intelligence

intro_continual_learning

This is a tutorial to connect the mathematics and machine learning theory to practical implementations addressing the continual learning problem of artificial intelligence. We will learn this in python by examining and deconstructing a method called elastic weight consolidation (EWC).

I wish there were more learning tools in this style that directly try to help the learner connect the math to the code, and do it using a simple but completely end to end project. While it is true that the average programmer can load a "out of the box" library in 5 minutes and be running the latest model solving a common task in 15 minutes, I often hear from engineers that although they are engineers, they feel under-developed in the math that underlies recent academic research in machine learning. I have received criticism from some that believe tutorials like this provide a shortcut for "average" engineers to "think" they understand the math behind a new flashy artificial intelligence concept, who think the joy of reading these papers should be reserved for the traditionally trained academics that have gone through the years of formal coursework. I think there is nothing wrong with motivating learners using a cool AI concept to learn more of the fundamental math on their own.

"anyone can cook" - ratatouille

What does elastic weight consolidation do?

The ability to learn tasks in a sequential fashion is crucial to the development of artificial intelligence. When an artificial neural network is trained on a new training set, unless that new training set includes all the old tasks combined with the new task, it generally is subject to catastrophic forgetting, whereby learning to solve new task B accompanies degradation of performance at old task A. In contrast, human neural networks can maintain expertise on tasks that they have not experienced for a long time. EWC addresses this problem by selectively slowing down learning on the weights (ie parameters, synaptic strengths) important for those old tasks.

Setup

  • Ubuntu 18.04.3 LTS (bionic)
  • Python 3.8
  • Cuda 10.1
  • cudnn7.6.4
  • PyTorch 1.10.0

These same steps should work on MacOS to

you@you:/path/to/folder$ pip3 install virtualenv

you@you:/path/to/folder$ virtualenv venv --python=python3.8

you@you:/path/to/folder$ source venv/bin/activate

(venv) you@you:/path/to/folder$ pip3 install -r requirements.txt

(venv) you@you:/path/to/folder$ jupyter notebook

Credit/References:

  1. James Kirkpatrick et al. Overcoming catastrophic forgetting in neural networks 2016(10.1073/pnas.1611835114)

  2. shivamsaboo17

  3. moskomule

More Repositories

1

RL-Chat-pytorch

reinforcement learning on a encoder-decoder GRU for chatbot dialogue generation
Jupyter Notebook
17
star
2

minichatgpt

annotated tutorial of the huggingface TRL repo for reinforcement learning from human feedback connecting equations from PPO and GAE to the lines of code in the pytorch implementation
Jupyter Notebook
12
star
3

chat-transformer

A chatbot using the Vaswani transformer as it's sequence-to-sequence module
Jupyter Notebook
11
star
4

unsupervised-speech-representation-learning

This is a intuitive explanation of Representation Learning with Contrastive Predictive Coding using code provided by jefflai108 that uses CPC to learn representations of sound files for the purpose of speech recognition
Jupyter Notebook
10
star
5

triton-ft-api

tutorial on how to deploy a scalable autoregressive causal language model transformer using nvidia triton server
Python
3
star
6

va-irl

Variational Adversarial Inverse Reinforcement Learning
Jupyter Notebook
2
star
7

proximalpolicyoptimization

basic implementation of PPO reinforcement learning algorithm on lunar lander
Jupyter Notebook
2
star
8

adaptive-computation-time

The notebook connects the formulas used in the paper to the code that implements those formulas by implementing a training pipeline on a small but meaningful dataset
HTML
1
star
9

General-Deep-Learning-NLP-Classifier

Template for multi-class classification with variable length sequences using Gated Recurrent Units
Jupyter Notebook
1
star
10

xgboost-tutorial

detailed tutorial on xgboost
Jupyter Notebook
1
star
11

max_ent_irl

Maximum Entropy Inverse Reinforcement Learning - notes and tutorial for IRL using the principle of maximum entropy
Jupyter Notebook
1
star