luzefengmagic / cnn-lstm-bilstm-deepcnn-clstm-in-pytorch

In pytorch Learing Neural Networks likes CNN(Convolutional Neural Networks for Sentence Classification (Y.Kim, EMNLP 2014) 、LSTM、BiLSTM、DeepCNN 、CLSTM、CNN and LSTM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

  • A classification task implement in pytorch, contains some neural networks in models.
  • Recenely, I've readjusted the code structure to make it easier to read.
    • The old version in the branch of old-version-17, It still works directly.
    • The newest version in here(master), It also can works directly now.

Requirement

pyorch : 0.3.1
python : 3.6.1
torchtext: 0.2.1
cuda : 8.0 (support cuda speed up, can chose)

Usage

modify the config file, see the Config directory(here) for detail.

1、python main.py
2、python main.py --config_file ./Config/config.cfg 

Model

Contains some neural networks implement in pytorch, see the models for detail.

Data

SST-1 and SST-2.

Result

I haven't adjusted the hyper-parameters seriously, you can also see train log in here.

The following test set accuracy are based on the best dev set accuracy.

Data/Model % SST-1 % SST-2
CNN-Rand 44.1629 82.2076
CNN 45.4751 84.3453
Bi-LSTM 48.1448 86.8753
Bi-GRU 48.1448 87.3696

Reference

Question

  • if you have any question, you can open a issue or email bamtercelboo@{gmail.com, 163.com}.

  • if you have any good suggestions, you can PR or email me.

About

In pytorch Learing Neural Networks likes CNN(Convolutional Neural Networks for Sentence Classification (Y.Kim, EMNLP 2014) 、LSTM、BiLSTM、DeepCNN 、CLSTM、CNN and LSTM

License:Apache License 2.0


Languages

Language:Python 100.0%