Giter Club home page Giter Club logo

dynamiccnn's Introduction

Dynamic Convolutional Neural Networks

Introduction

This is a Theano implementation of the paper "A Convolutional Neural Network for Modelling Sentences" (click here). The example included is that of binary movie review sentiment classification (Stanford Sentiment Treebank). I was able to achieve a test set accuracy of 85-86% which is just below the reported accuracy of 86.8%.

Using it

To run it, simply run trainDCNN.py. If you are only interested in the layers such as Dynamic K-max pooling, or the 1D convolution, only use the DCNN package.

Paper/implementation issues

There is some discrepancy between the paper and Matlab code provided. Therefore, it was difficult to rely on the Matlab code for details not provided in the paper. For example: (1) different number of layers and filters. (2) the L2 regularization is not specified in the paper but is very detailed in the code (different values for different matrices). It would be hard to guess those values.

Implementation details

The layers of the network are wrapped as Lasagne layers and can be easily reused. In the paper, some layer types were introduced which are not trivial for Theano. (1) 1D convolution layers that only apply row wise convolutions and not on all rows at once. (2) Dynamic K-max pooling. Currently an argsort operation is used which is executed on the CPU. However, this operation is too heavy for selecting the K max values.

Because of these implementation issues, a very heavy GpuContiguous operation is automatically introduced somewhere. If you have a solution or comments, I'm happy to support pull requests ;)

dynamiccnn's People

Contributors

fredericgodin 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.