Giter Site home page Giter Site logo

chianwei / mpcnn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yat011/mpcnn

0.0 1.0 0.0 11 KB

Tensorflow Implementation: Multi-Perspective Sentence Similarity Modeling with Convolutional Neural Networks

License: MIT License

Jupyter Notebook 100.00%

mpcnn's Introduction

mpcnn

Tensorflow Implementation: Multi-Perspective Sentence Similarity Modeling with Convolutional Neural Networks

This project implement the network (slightly different) from the paper Multi-Perspective Sentence Similarity Modeling with Convolutional Neural Networks

Test

Tested on the training set of Quora Question Pair

  • word2vec word-embedding: 0.33621892 logloss
  • glove word-embedding: 0.3132183 logloss

Details/Problem

As the input of sentence has variable length, padding is usually used for creating tensor with same shape, which enables parallel computation and provides better computational locality. However, padding will affect the result of mean-pool and min-pool because there are lots of zeros added to the sample.

  • Mean pool:
    • Problem: direct use mean operation would include the padding zero
    • Solved by: sum(output of conv) / sentence_length_tensor
  • Min pool (not using in the code, to be improved):
    • Problem: min pool would always return zero due to padding zero
    • Not Exactly Same: use min(output_of_conv + min_mask)
      • Min_mask is 2d tensor. If t-th input is padding zero, then the t-th value of the mask is 1e7 (large value) such that the min pool value is less affected by padding sequence. (P.s. conv.layer using SAME padding method and the min pool value is not exact equal to that without padding sequence)

TO BE CONTINUED

  • extract and consolidate the code from the notebook into package

mpcnn's People

Watchers

 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.