Giter Club home page Giter Club logo

swix's Introduction

Swift Matrix and Machine Learning Library

Apple's Swift is a high level language that's asking for some numerical library to perform computation fast or at the very least easily. This is a bare-bones wrapper for that library.

A way to have iOS run high-level code similar to Python or Matlab is something I've been waiting for, and am incredibly excited to see the results. This will make porting complex signal processing algorithms to C much easier. Porting from Python/MATLAB to C was (and is) a pain in the butt, and this library aims to make the conversion between a Python/Matlab algorithm and a mobile app simple.

In most cases, this library calls Accelerate or OpenCV. If you want to speed up some function or add add another feature in those libraries, feel free to submit a pull request (preferred!) or contact me at @stsievert or [email protected]. Oh, and if you use this project I'd love to hear about it.

Currently, this library gives you

  • operators and various functions (sin, etc) that operate on entire arrays
  • helper function (reshape, reverse, delete, repeat, etc)
  • easy initializers for 1D and 2D arrays
  • complex math (dot product, matrix inversion, eigenvalues, etc)
  • machine learning algorithms (SVM, kNN, SVD/PCA, more to come)
  • one dimensional Fourier transforms
  • speed optimization using Accelerate and OpenCV

When I was crafting this library, I primarily followed the footsteps and example set by NumPy. For the more complex mathematical functions (e.g., SVD) I tested it against NumPy. Matlab, at least for the SVD, returns slightly different output.

Additionally, I followed NumPy's syntax whenever possible. For example, NumPy and Matlab differ in their initializer called ones by ones((M,N)) and ones(M, N) respectively. If in doubt or getting weird compiler bugs, look at NumPy for Matlab users or the section on possible swix bugs that may pop up during the Install or other Bugs you may find.

Documentation

Details on how to install can be found in Install. The swix documentation includes details on each individual function and possible bugs.

Third Party Frameworks/Libraries

To be integrated

Uses

FAQ

Why does this library exist?

Not only should you be able to do simple math in arrays like in Surge, Swift makes it possible to call high level mathematical functions just like in Python/Matlab.

How does this library compare to Python/Matlab?

Complete speed results can be found in Speed

swix's People

Contributors

arondes avatar harenbrs avatar jcarlson23 avatar sergey-salnikov avatar torb avatar

Watchers

 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.