Giter Club home page Giter Club logo

grokking's Introduction

GROKKING: GENERALIZATION BEYOND OVERFITTING ON SMALL ALGORITHMIC DATASETS

unofficial re-implementation of this paper by Power et al.

code written by Charlie Snell

pull and install:

git clone https://github.com/Sea-Snell/grokking.git
cd grokking/
pip install -r requirements.txt

To roughly re-create Figure 1 in the paper run:

export PYTHONPATH=$(pwd)/grokk_replica/
cd scripts/
python train_grokk.py

Running the above command should give curves like this.

Try different operations or learning / architectural hparams by modifying configurations in the config/ directory. I use Hydra to handle the configs (see their documentation to learn how to change configs in the commandline etc...).

Training uses Weights And Biases by default to generate plots in realtime. If you would not like to use wandb, just set wandb.use_wandb=False in config/train_grokk.yaml or as an argument when calling train_grokk.py

grokking's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

grokking's Issues

ModDivisonDataset

Why do you have (a * pow(b, self.p-2, self.p)) % self.p for ModDivisonDataset? Shouldn't it be (a / b) % self.p?

Default p is 96 instead of 97.

The value for p in the train grokk config file is 96, but should probably be 97. As far as I can tell the 96 then overrides the 97 from the dataset config default.

Default weight_decay is 0

According to paper, the weight_decay should be 1. However, your config has it as 0. Is this correct? I am trying to reproduce Figure 1 and I thought that must have been produced with weight_Decay=1 per appendix A.1.2.

Conflicts when installing requirements

When I try to install this repo on my computer, I met some difficulties when installing requirements.txt.
The conflict is caused by:
The user requested numpy
mkl-fft 1.3.1 depends on numpy<1.23.0 and >=1.22.3
torchvision 0.11.1 depends on numpy
mkl-random 1.2.2 depends on numpy<1.25.0 and >=1.24.3

I will appreciate it if you can update your requirements.txt with more simplified package requirements and more detailed version information. Thanks a lot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.