Giter Club home page Giter Club logo

inc_prox_pt's Introduction

Pytorch based implementations of proximal operators for useful functions in machine learning. The code is based on a series of blog posts in my blog - https://alexshtf.github.io. See the examples folder for usage examples.

The project consists of several modules for implementing proximal operators for various function types:

  • cvxlin for compositions of a convex function onto a linear function. Useful for least squares and logistic regression.
  • cvxlinreg for regularized variants of the above. Useful for Lasso, or L1 / L2 regularized logistic regression.
  • minibatch_cvxlin for mini-batch variants of a convex onto linear composition. Useful for training least squares of logistic regression models using proximal operators applied to mini-batches of loss functions.
  • cvxlips_quad for a composition of a convex and Lipschitz function onto a quadratic function. Useful for problems such as phase retrieval, or factorization machines for CTR prediction (experimental)

Thhe experiments directory contains numerical experimentation code which demonstrates that we indeed achieve stability w.r.t step size choice, as theory papers predict, and the execution speed of our methods compared to naive gradient descent.

Example - solving a phase retrieval problem using an incremental proximal point algorithm:

import math
import torch
from cvxlinreg import IncRegularizedConvexOnLinear, Logistic, L2Reg

w = torch.zero(dim)
opt = IncRegularizedConvexOnLinear(w, Logistic(), L2Reg(0.01)) # L2 regularized logistic regression
for t, (x, y) in enumerate(dataset):
    step_size = 1 / math.sqrt(t)
    opt.step(step_size, -y * x, 0)  # ln(1 + exp(-y * <w, x> + 0))

inc_prox_pt's People

Contributors

alexshtf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.