Code Monkey home page Code Monkey logo

nan's Introduction

NaN

Discription

This is a linear algebra library like Numpy, with less utilities kernels such as a lot of the array manipulation functionalities. The goal of this libarary is to run matrix calculation on both CPU and GPU, so more functions will be implemented in the near future. Rigth now the following kernels are available.

matrix generation kernels

  1. eye
  2. zeros
  3. randn(normal distribution)
  4. rand(uniform distribution)
  5. rot2
  6. rot3

matrix math kernels

  1. add/substract
  2. matmul
  3. eigenvalue decomposition
  4. SVD
  5. LU Decomposition
  6. matrix inverse
  7. pseudo-inverse for non-square matrix

Some Example

from NaN.lib import matGen as mg
from NaN.lib import ops
from NaN.matrix import matrix

# to create a matrix
a = matrix([[1,2,3],[2,3,4],[5,6,7]], 'double')
# to generate a matrix with normal distribution value
# with mean of 0 and std of 1
a = mg.randn((2, 3), (0, 1), 'double')
# to generate a matrix with uniform distribution value
# from 0 to 5
b = mg.rand((3, 2), (0, 5), 'double')
# do a matmul
c = a*b

# do a Singlar Value Decomposition
u,s,vt = ops.svd(c)

Requirements

Installation of BLAS in pip is very slow and the performance is not great either, so we recommand using a conda environment for optimal performance(see BLAS Recommandation)

Installation

  1. run "pip install ." to install the library

TODO

  1. QR and Chol decomposition
  2. solvers
  3. outter/inner/dot/kron product
  4. GPU support

BLAS Recommandation

It is highly recommanded that you use a conda environment for this library since it provides a much faster BLAS compared to pip. To install BLAS from conda, type in:

foo@whoami:~$ conda install -c anaconda openblas

before you pip install this library

nan's People

Contributors

jiex-liu avatar

Watchers

 avatar

Forkers

wang-thomas

nan's Issues

Setting up requirements lead to errors

Running the requirements file per instructions of README leads to errors. I didn’t have conda installed. After installing anaconda, it still didn’t work right out the gate. Would prefer a setup without using conda!!

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.