Giter Club home page Giter Club logo

gols's Introduction

CUDA Generalized Orthogonal Least Squares

Coren Bialik, 2018.

This is a GPU implementation of Generalized Orthogonal Least-Squares (GOLS) following Hashemi and Vikalo. It solves the following problem: $$ \mathop{\mathrm{min}} \lVert A_{ij} x_j - b_i\rVert_2, :\text{subject to} :\lVert x\rVert_0 \leq k $$

Thus it can be used for a set of sparse approximation problems, like supervised feature selection, or classification, or just generally as an EDC for your sparse approximation tasks.

The implementation is based on CUDA/cuBLAS, uses ModernGPU for buffer allocation and copies, the caching allocator from CUB to create a memory pool.

Note: some of the many things that keep this short of a production-level implementation

  • error handling and reporting would have to be improved
  • cta launches are not optimal for all problem sizes -- especially small problems (like I could run it with "python" small) could benefit from better parallelization

Building

Basic:

git clone --recursive URL
mkdir build
cd build
cmake ..
make

Or simply:

python setup.py install

Usage

There's a python interface based on pybind11 (btw: <3), a C, and a C++ interface (gols.hxx).

import gols
help(gols.solve)

See the jupyter notebook in ./play for example usage.

gols's People

Contributors

corenbialik avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gols's Issues

Python docstrings

Currently only an _extension.so. Add __init__.py and maybe setup.py and put in a nice docstring.

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.