Code Monkey home page Code Monkey logo

py-sparse-filtering's Introduction

py-sparse-filtering

Python implementation of the Sparse Filtering code by Ngiam et al.

Dependencies

The main code depends on numpy and scipy's optimization toolkit. For the demo you also need matplotlib/pylab for visualization and scipy.io.loadmat for reading in the image data.

The image data is the same as the data used by Jiquan Ngiam et al., and can be downloaded from http://cs.stanford.edu/~jngiam/data/patches.mat.

py-sparse-filtering's People

Contributors

singhblom avatar

Stargazers

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

Watchers

 avatar  avatar

py-sparse-filtering's Issues

Sparse Filtering in R

Hi,

I tried to implement the sparse filtering in R but got this warning message, do you know what it is?
Warning messages:
1: In optimx.run(par, optcfg$ufn, optcfg$ugr, optcfg$uhess, lower, :
Hessian is reported non-symmetric with asymmetry ratio 0.551328252008331
2: Hessian forced symmetric

Subtracting the mean

I believe there is a slight mistake on the demo script (sparseFilteringDemo.py). In the original MATLAB code by Ngiam, the DC is subtracted from the data as:

%% Remove DC
data = bsxfun(@minus, data, mean(data));

This subtracts the column-wise mean from the data. However, in the sparseFilteringDemo.py (line 72), the DC is subtracted as:

data -= data.mean()

This subtracts the mean of the flattened array (i.e. a scalar), not the column-wise mean. The correct code should be:

data -= data.mean(axis=0)

Same with data1 on line 82.

Thank you,

Shigeru

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.