Code Monkey home page Code Monkey logo

eunn-tensorflow's Introduction

EUNN-tensorflow

Unitary neural network is able to solve gradient vanishing and gradient explosion problem and help learning long term dependency. EUNN is an efficient and strictly enforced unitary parametrization based on SU(2) group. This repository contains the implementation of Efficient Unitary Neural Network(EUNN) in tensorflow.

If you find this work useful, please cite arXiv:1612.05231.

I am working on submitting this code to tf.contrib so that in the future you can use it directly from official tensorflow.

Installation

requires TensorFlow > 1.2.0

Demo

./demo.sh

Usage

To use EUNN in your model, simply copy eunn.py.

Then you can use EUNN in the same way you use built-in LSTM:

from eunn import EUNNCell
cell = EUNNCell(hidden_size, capacity, fft, complex)

Args:

  • hidden_size: Integer.
  • capacity: Optional. Integer. Only works for tunable style.
  • fft: Optional. Bool. If True, EUNN is set to FFT style. Default is False.
  • complex: Optional. Bool. If True, EUNN is set to complex domain. Default is True.

Note:

  • For complex domain, the data type should be tf.complex64
  • For real domain, the data type should be tf.float32

Example tasks for EUNN

Copying memory task and pixel-permuted MNIST task for RNN in the paper are shown here. Due to copyright issue, we cannot release TIMIT task.

Copying Memory Task

python copying_task.py --model eunn --T 200 --fft

Pixel-Permuted MNIST Task

python mnist_task.py --model eunn --iter 20000 --hidden 512 --complex False 

License

MIT License

eunn-tensorflow's People

Contributors

damaru2 avatar jingli9111 avatar vanjo9800 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eunn-tensorflow's Issues

TF 2

Hello,

thank you very much for that great layer EUNN, really liked the paper!

Do you know if it is compatible with tensorflow 2?

Thank you,

White space/formatting problems on permuted MNIST task

Hi Li,

this work is really cool, thank you very much for posting it! I ran the copy task, and it's great!

I just tried to run the MNIST task, but I seem to have some problems with white spaces/formatting. In particular I get lots of errors like this,

(pyphi) ajay@ajay-h8-1170uk:~/PythonProjects/EUNN-tensorflow-master$ python mnist_task.py EURNN -I 2000 -B 128 -H 128 -L 4 -C True 
  File "mnist_task.py", line 64
    ind = range(784)
                   ^
TabError: inconsistent use of tabs and spaces in indentation
(pyphi) ajay@ajay-h8-1170uk:~/PythonProjects/EUNN-tensorflow-master$ 

Could you please check the formatting of that file? I'd like to run it on your MNIST task, before trying to replace LSTM in other tasks. I don't like LSTM, it's too weird for me!

I'm using python 3.6.0 if that helps?

Thanks a lot for your help,

Aj

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.