Skip to content

A TensorFlow 2.0 with eager execution implementation of Pytorch OpenAI few-shot regression toy example

Notifications You must be signed in to change notification settings

jaredquekjz/reptile-tf2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

The task

predicting a random sine wave from just 10 (x,y) pairs

What is Reptile algorithm

Reptile is a simple meta-learning(learning how to learn) optimization algorithm similar to the amazing MAML algorithm which i recommend to read the MAML paper. Both of MAML and Reptile are model-agnostic so they work with any model that learns through gradient descent. Reptile is more simple and comutational efficient than MAML algorithm.

How does it works ?

Alt text

The Reptile works by repeatedly:

  1. sampling a task,
  2. training on it by multiple gradient descent steps,
  3. and then moving the model weights towards the new parameters.

Intuitively,

Alt text

The Reptile algorithm find a parameter theta that is close to all the optimal manifolds of all tasks

Dependencies

This code requires the following:

  • Python 3.5.2+
  • TensorFlow 2.0.0-beta0
  • Numpy
  • Matplotlib

References

  • Reptile Paper: Alex Nichol, Joshua Achiam, John Schulman. "On First-Order Meta-Learning Algorithms".
  • OpenAI blog post: Check it out, they have an online demo running entirely in Javascript!
  • MAML Paper: Chelsea Finn, Pieter Abbeel, Sergey Levine. "Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks".

Contact

To ask questions or report issues, please open an issue on the issues tracker

About

A TensorFlow 2.0 with eager execution implementation of Pytorch OpenAI few-shot regression toy example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 100.0%