Code Monkey home page Code Monkey logo

regressionsphere's Introduction

Regression of a Target Function on the Sphere

Code for the paper Learning sparse features can lead to overfitting in neural networks appeared at NeurIPS 2022. Details for running experiments can be found in experiments.md.

Neural Network Training

Run main.py

Architecture. Train a one hidden-layer fully-connected neural network on the mean square error.

Data-set. Data samples x can be drawn from

  • the d-dimensional normal distribution, args.dataset = normal;
  • uniform distribution inside the sphere, uniform;
  • or uniform distribution on the spherical surface, sphere.

The target is either

  • the sample norm ||x||, args.target = norm;
  • or a Gaussian random field computed through an ~infinite-width teacher network (args.target = teacher) with relu or abs activation function to some power a. Here examples of the Gaussian random field defined on the sphere in d=3:

data_sample

Algorithm. Full batch gradient descent can be performed with

  • the alpha-trick by setting args.alpha larger (lazy) or smaller (feature) than one.
  • a regularization args.l on the l2 norm of the parameters (args.reg = 'l2'), on the path norm ||w1|| * |w2| (args.reg = 'l1') or on the l1 norm |w2| by fixing the first layer weights on the unit sphere ||w1|| = 1 (args.reg = 'l1' and args.w1_norm1 = 1).

Additionally, conic gradient descent [Chizat and Bach, 2018] can be performed by setting args.conic_gd = 1.

Kernel Ridge Regression (KRR)

Run main_krr.py

Student kernel. Analytical NTK of an infinite-width one-hidden-layer neural network.

Data-set. see above.

Ridge. The regularization or ridge parameter can be fixed by args.l (default: 0).

regressionsphere's People

Contributors

leonardopetrini avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.