Code Monkey home page Code Monkey logo

adaptiveoptim's Introduction

AdaptiveOptim

Source code for the experiments and figures of the paper "Adaptive Acceleration of Sparse Coding via Matrix Factorization ".

Requirements

  • numpy 1.10+
  • matplotlib 1.8+
  • tensorflow 0.9+
  • scikit-learn 1.16+

All the development was done with python3.4 and might not work for earlier versions.

Usage

Use the main script NIPS_figures.py to launch the experiements. Various option are available from the command line. See python NIPS_figures.py --help for more information.

To generate the 4 figures from the paper, use:

python NIPS_figures.py --data artificial --save_dir layer1
python NIPS_figures.py --data artificial --rho .2 --save_dir layer2
python NIPS_figures.py --data mnist --lmbd .1 -K 100 --save_dir mnist
python NIPS_figures.py --data images --lmbd .05 --save_dir images

adaptiveoptim's People

Contributors

tommoral avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

adaptiveoptim's Issues

inputs must be a list of at least one Tensor with the same dtype and shape

It's a great job!!! When I run the cmd, python NIPS_figures.py --data artificial --save_dir layer1, an error happened like below, I wonder how to solve.

Traceback (most recent call last):
File "/AdaptiveOptim/NIPS_figures.py", line 249, in
network = LinearNetwork(D, 1, gpu_usage=gpu_usage, exp_dir=NAME_EXP)
File "\AdaptiveOptim\adaopt\linear_network.py", line 28, in init
super().init(n_layers=n_layers, name=name, **kwargs)
File "\AdaptiveOptim\adaopt_loptim_network.py", line 22, in init
self._construct()
File "\AdaptiveOptim\adaopt_loptim_network.py", line 77, in _construct
self._train = self._mk_training_step()
File "\AdaptiveOptim\adaopt\linear_network.py", line 153, in _mk_training_step
_reg = tf.add_n(tf.get_collection("regularisation"))
File "C:\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\ops\math_ops.py", line 2222, in add_n
raise ValueError("inputs must be a list of at least one Tensor with the "
ValueError: inputs must be a list of at least one Tensor with the same dtype and shape

Error while running NIPS_figures.py

I use the cmd :
python NIPS_figures.py --data artificial --save_dir layer1

and I get the error:

 Traceback (most recent call last):
  File "NIPS_figures.py", line 305, in <module>
    lr_init=lr_init/n_layers)
  File "/Users/Sadjad/git/AdaptiveOptim/Lcod/facto_network.py", line 226, in train
    self._feed_val = self._convert_feed(feed_val)
  File "/Users/Sadjad/git/AdaptiveOptim/Lcod/_loptim_network.py", line 305, in _convert_feed
    for k, v in feed.items():
AttributeError: 'int' object has no attribute ‘items' 

The modifications I made to the code (I am running this on mac OS, so I don’t have GPU):
Since I have my tensorflow installed with python2.7.13, I had to replace:

  • super() with super(ChildClassName, self)
  • FileNotFoundError with IOError

I have numpy 1.12.0, matplotlib 1.5.3, and sklearn 0.17.1

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.