GithubHelp home page GithubHelp logo

danielmamay / grokking Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 6.0 912 KB

Implementation of OpenAI's 'Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasets' paper.

License: MIT License

Python 100.00%
deep-learning machine-learning

grokking's People

Contributors

danielmamay avatar

Stargazers

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

Watchers

 avatar

grokking's Issues

[BUG] composing the input equation.

Thanks for your implementation. However, I believe there is a bug at the following lines:

https://github.com/danielmamay/grokking/blob/a1b9d96a92cfae3c10aa0b3b76b66b4cea041635/grokking/data.py#L36C1-L37C1

ALL_OPERATIONS[operation](x, y, p) is a lambda function. Under default setting: lambda x, y, p: (x*y % p, y, x).

This lambda function returns a tuple with three elements in the following order: solution-of-the-equation, y-value, x-value

The solution-of-the-equation should be the label. However, in the code, we have:

x, y, z = ALL_OPERATIONS[operation](x, y, p)
results = z.remainder(p)
inputs = torch.stack([x, op, y, eq], dim=1)
labels = results

Where the x is treated as the input, but the value of x is actually the solution to x*y%p.

Can you please conduct an investigation on this matter?

Also, I do not quite understand why you have z.remainder(p) here (assuming z is passed by the solution to the equation).

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.