Code Monkey home page Code Monkey logo

frp's Introduction

frp: Fast Randomized Projections

We use Blaze for fast linear algebra, Sleef for fast trigonometric operations, Fast Fast-Hadamard Transform from FALCONN-LIB for the Fast Hadamard Transform, FFTW3 for the FFT, and boost for special functions and random number generators. Only required boost headers are provided as submodules and no installation of boost is required.

Contents

  1. Orthogonal JL transform with linear space and linearithmic runtime
    1. This is available through the ojlt executable, in C++ programs accessing include/frp/jl.h, and using python bindings.
    2. Python bindings can be installed by cd python && python3 setup.py install.
  2. Kernel projections
    1. We support kernel approximation for the Gaussian kernel using Random Fourier Features, Orthogonal Random Features, Structured Orthogonal Random Features, and FastFood.
    2. We recommend Structured Orthogonal Random Features, as it has the highest accuracy in our experiments and can also be hundreds of times faster while still having a small memory footprint.
  3. A type-generic SIMD interface (vec/vec.h), which abstracts operations to allow the compiler to use the widest vectors possible as needed, facilitating generically dispatching the fastest implementation possible on a machine.
  4. Utilities 2. PRNVector (PseudoRandom Number Vector) to provide access to random vectors using only constant memory requires instead of explicitly storing them by generating values as needed. 3. Utilities for sampling and filling containers from distributions. 4. Acquiring cache sizes from the OS.
  5. Linear algebra methods
    1. Implementation of the Gram-Schmidt algorithm for orthogonalizing matrices.
    2. PCA using full eigendecomposition for symmetric matrices.
    3. Covariance Matrix calculation
  6. Miscellaneous, related work
    1. Dynamic Continuous Indexing for real-valued data
      1. Dynamic Continuous Indexing
      2. Tested
      3. Prioritized DCI
      4. Draft form.

Build instructions

make should compile a variety of tests. We assume you're using BLAS for your linear algebra; to avoid doing that, modify the Makefile and remove the -DBLAZE* flags.

To specify a different blas header file, use the CBLASFILE variable when compiling:

make ojlt CBLASFILE=mkl_cblas.h
# Or, use an environmental variable
export CBLASFILE=mkl_cblas.h && \
make ojlt

Commentary

The initial design of this library was to implement methods from https://arxiv.org/abs/1703.00864. The core transformss on which it is built are fast fast-hadamard transform accelerated structured matrix vector products. This has applications in memory-efficient, accelerated Johnson-Lindenstrauss Transforms, gaussian kernel approximation for linearizing datasets and FastFood/Adaptive Random Spinners.

DCI/Prioritized DCI usage

Notes:

During construction, it may be advantageous to use a std::set to maintain sorted indexes (logarithmic update time), whereas at query time, it's faster to use a contiguous array. We provide the cvt function, which copies the index, but converts the sorted index type from what it used to be (usually a red-black tree) into the destination type, by default an always-sorted array.

We suggest doing this for the purposes of faster construction and faster queries.

Additionally, we do not store any points, just references to them.

When using a non-default container which supports lower_bound functionality, one needs to both use std::less<void> for a comparator and overload has_lower_bound_mf struct.

frp's People

Contributors

attdnb avatar dnbaker avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

frp's Issues

cblass_sgemm error in libblass

Hi Daniel,

I tried to compiled again with the last commit, but unfortunately, I received another error.

The error is:

/usr/bin/ld: /tmp/ccfo33G4.o: reference without defined symbol 'cblas_sgemm'
//usr/lib/x86_64-linux-gnu/libblass.so.3: error adding symbols: DSO missing from command line
colect2: error: ld returned 1 exit status
Makefile:95L: recipe for target 'pcatestf' failed
make: *** [pcatestf] Error 1

The dependencies that I installed was the following:

sudo apt install libssl-dev
sudo apt-get install libz-dev

sudo apt-get install gfortran
sudo apt-get install libblas-dev liblapack-dev

apt-get install libfftw3-dev

I'm using Ubuntu 18.04

cd py && make inside Makefile

Hi Daniel,

I just made a git pull and after tried to perform the make, I received an error with the command

cd py && make.

It seems that inside py is not a Makefile available.

I tried to remove that line but after doing that the making process stops at that line.

Python compiled error, dynamic_lookup was not found

Hi Daniel,

I had another error :(.

I installed python3 with pybind11 for the wrapper to C++

apt install python3-dev
apt install python3-pip
pip3 install pybind11

With the make command, I received the following error: dynamic_lookup -> this file or directory does not exist.

I searched on google for any advisement, but I did not find any help.

It occurs at the end of the make compilation.

What could be the problem?

setup.py no such file or directory

After doing a make command an error is generated.

Now, it seems that inside py there is not a setup.py file. I received a message "no such file or directory"

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.