Git Product home page Git Product logo

caffe-lstm's Introduction

LSTM Implementation in Caffe

Note that Jeff Donahue's implementation will be merged to Caffe (not this code).
Jeff's code is more modularized, while this code is optimized for LSTM.
This code computes gradient w.r.t. recurrent weights in a single matrix computation.

  • Speed comparison (Titan X, 3-layer LSTM with 2048 units)

    • Batch size = 20, Length = 100
    Code Forward(ms) Backward(ms) Total (ms)
    This code 248 291 539
    Jeff's code 264 462 726
    • Batch size = 4, Length = 100
    Code Forward(ms) Backward(ms) Total (ms)
    This code 131 118 249
    Jeff's code 140 290 430
    • Batch size = 20, Length = 20
    Code Forward(ms) Backward(ms) Total (ms)
    This code 49 59 108
    Jeff's code 52 92 144
    • Batch size = 4, Length = 20
    Code Forward(ms) Backward(ms) Total (ms)
    This code 29 26 55
    Jeff's code 30 61 91

Example

An example code is in /examples/lstm_sequence/.
In this code, LSTM network is trained to generate a predefined sequence without any inputs.
This experiment was introduced by Clockwork RNN.
Four different LSTM networks and shell scripts(.sh) for training are provided.
Each script generates a log file containing the predicted sequence and the true sequence.
You can use plot_result.m to visualize the result.
The result of four LSTM networks will be as follows:

  • 1-layer LSTM with 15 hidden units for short sequence Diagram
  • 1-layer LSTM with 50 hidden units for long sequence Diagram
  • 3-layer deep LSTM with 7 hidden units for short sequence Diagram
  • 3-layer deep LSTM with 23 hidden units for long sequence Diagram

caffe-lstm's People

Contributors

shelhamer avatar jeffdonahue avatar yangqing avatar longjon avatar sguada avatar kloudkl avatar sergeyk avatar ronghanghu avatar qipeng avatar junhyukoh avatar rbgirshick avatar flx42 avatar dgolden1 avatar mavenlin avatar philkr avatar lukeyeager avatar jamt9000 avatar tnarihi avatar yosinski avatar erictzeng avatar cypof avatar mohomran avatar jyegerlehner avatar mtamburrano avatar netheril96 avatar ste-m5s avatar pluskid avatar tdomhan avatar ducha-aiki avatar chyojn avatar

Watchers

James Cloos 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.