Coder Social home page Coder Social logo

priodyuti / frequentdirections Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brian-lau/frequentdirections

0.0 1.0 0.0 118 KB

Matlab implementation of Frequent Directions variants for matrix sketching

License: GNU General Public License v3.0

MATLAB 100.00%

frequentdirections's Introduction

FrequentDirections

Matlab code for matrix sketching using Frequent Directions (FD) variants. Implements the original and fast FD algorithms (Liberty, 2013), a parameterization that varies smoothly between iterative SVD and FD (Desai et al, 2016), as well as a randomized variant suited for sparse inputs (Teng & Chu, 2017).

Installation

Add the single file FrequentDirections.m to your Matlab path. Adding the directory Examples to the path is useful for running the examples. Unit tests can be run from the Testing directory.

Examples

To sketch an in-memory matrix:

k = 16;                            % sketch size
sketcher = FrequentDirections(k);  % Initialize object
d = 64;                            % data dimensionality
data = randn(1000,d);
sketcher(data);                    % process samples
get(sketcher)                      % return sketch
sketcher.coverr(data)              % covariance error
sketcher.projerr(data)             % projection error

To sketch streaming data:

d = 512;                           % different data dimensionality
sketcher = FrequentDirections(32); % Initialize object
count = 0;
while count < 1000
   data = randn(1,d);              % random sample
   sketcher(data);                 % consume sample
   count = count + 1;
end
get(sketcher)                      % return sketch

The script exampleDesai.m reproduces a figure from Desai et al. 2016 illustrating the performance and runtime of different FD variants: Drawing

References

Contributions

Copyright (c) 2017 Brian Lau [email protected], see LICENSE

Please feel free to fork and contribute!

frequentdirections's People

Contributors

brian-lau avatar

Watchers

Priodyuti Pradhan 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.