Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nvinuesa/sparsal
Sparse approximation library
https://github.com/nvinuesa/sparsal
scala signal-processing sparse sparse-coding
Last synced: 23 days ago
JSON representation
Sparse approximation library
- Host: GitHub
- URL: https://github.com/nvinuesa/sparsal
- Owner: nvinuesa
- License: mit
- Created: 2017-01-06T21:07:34.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-14T18:32:59.000Z (over 7 years ago)
- Last Synced: 2023-07-01T01:06:14.682Z (over 1 year ago)
- Topics: scala, signal-processing, sparse, sparse-coding
- Language: Scala
- Homepage:
- Size: 22.5 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## sparsal - Sparse Approximation Library
[![Build Status](https://travis-ci.org/underscorenico/sparsal.svg?branch=master)](https://travis-ci.org/underscorenico/sparsal)
[![codecov](https://codecov.io/gh/underscorenico/sparsal/branch/master/graph/badge.svg)](https://codecov.io/gh/underscorenico/sparsal)
[![Chat](https://badges.gitter.im/sparsal/Lobby.svg)](https://gitter.im/sparsal/Lobby)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/underscorenico/sparsal/master/LICENSE.txt)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.underscorenico/sparsal_2.12.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.underscorenico/sparsal_2.12)## Overview
The Sparse Approximation Library aims to provide easy-to-read, modern and maintainable sparse approximation algorithms written in a functional style.
At the moment only [the matching pursuit algorithm][mp] is implemented. Future versions will increment the number of algorithms.
Check [this article][blog] for some basic theoretical background.[blog]: https://underscorenico.github.io/blog/2017/01/14/about-sparsal
[mp]: https://en.wikipedia.org/wiki/Matching_pursuit## Using sparsal
Builds are available for scala 2.10.x, 2.11.x and 2.12.2.
### SBT
Simply add sparsal's dependency to your build.sbt if you don't know which version of scala you are using and sbt will automatically detect and search for the appropriate package:
```scala
libraryDependencies += "com.github.underscorenico" %% "sparsal" % "0.2.0"
```
Or either specify the desired target version:
```scala
libraryDependencies += "com.github.underscorenico" % "sparsal_2.12" % "0.2.0"
```### Maven
If you are using Maven, simply add sparsal to your dependencies to your pom.xml:
```xmlcom.github.underscorenico
sparsal_2.12
0.2.0```
### Try itFirst initialize your MatchingPursuit (or Orthogonal Matching Pursuit) object with an input and a defined dictionary:
```scala
val input = Array.fill(10)(5)val dictionary = Gabor(input.length)
val mp = MatchingPursuit1D(input, dictionary)
```
Then recover the approximation (after the algorithm converges to a certain provided accuracy measure):
```scala
val result: (List[(Double, Int)], Seq[Double]) = mp.run(SNR(20.0))
```
The result will contain a list of selected atoms from the dictionary. The first element of the touple (type Double) will contain the inner product between the input at Iteration n-1 and the selected atom.
The second element contains the index of the atom from the dictionary.## Contributing
Everyone is welcome to contribute, either by adding features, solving bugs or helping with documentation.
Sparsal embraces [the open code of conduct][codeofconduct] from the [TODO group][todogroup], therefore all of its channels should respect its guidelines.
That being said, we are a community and we should not need guidelines for our conduct but leave it to our common sense instead.[codeofconduct]: http://todogroup.org/opencodeofconduct
[todogroup]: http://todogroup.org