jiangqy / LSTM-Classification-pytorch

Text classification based on LSTM on R8 dataset for pytorch implementation
140 stars 56 forks source link

Code improvements #6

Open Dirguis opened 5 years ago

Dirguis commented 5 years ago

Hello jiangqy, Thanks for sharing the code. A quick note, to mention that the code could be improved by using a few tricks here and there, in 20 epochs. Using an updated code and the exact same data as you, I get an accuracy of 0.933. Note that I got the same accuracy as described by you in your Readme the first time I ran your code. Let me know if you are interested in updating your code and I can start a pull request. If not, I would like to then create a repo if this example and the updated code, mentioning you and your repo as well of course. Cheers!

LSTM_classifier_08-Apr-04-1554736103

jiangqy commented 5 years ago

No problem. You can pull a request.

Best regards. Qing-Yuan.

----- Original Message ----- From: Damien Forthomme [mailto:notifications@github.com] To: jiangqy/LSTM-Classification-Pytorch [mailto:LSTM-Classification-Pytorch@noreply.github.com] Cc: Subscribed [mailto:subscribed@noreply.github.com] Sent: Sat, 06 Apr 2019 16:54:03 +0000 Subject: [jiangqy/LSTM-Classification-Pytorch] Code improvements (#6)

Hello jiangqy, Thanks for sharing the code. A quick note, to mention that the code could be dramatically improved by using a few tricks here and there, in 11-12 epochs. Using an updated code and the exact same data as you, I get an accuracy of 0.999. Note that I got the same accuracy as described by you in your Readme the first time I ran your code. Let me know if you are interested in updating your code and I can start a pull request. If not, I would like to then create a repo if this example and the updated code, mentioning you and your repo as well of course. Cheers!

LSTM_classifier_06-Apr-04-1554568792

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jiangqy/LSTM-Classification-Pytorch/issues/6

Dirguis commented 5 years ago

Hello Qing-Yuan,

Sorry, I had the wrong numbers, I edited my first message. I get an accuracy of 0.933, with a slightly increasing loss, which is a nice improvement.

The main changes are about creating my own custom dataset, changing the optimizer and packing the sequences. I cleaned up the repo a bit as well. There are several other things I would like to do with this dataset, but for now I have a running code here. Note that it is the model_upgrade branch.

You can see if this is good enough with you or if you want to add other modifications or wait for a bit more improvements if I can.

Cheers!

Damien

Dirguis commented 5 years ago

Hello Qing-Yuan,

I have pushed my changes to master on my repo: https://github.com/Dirguis/LSTM-Classification-Pytorch/tree/master

I can get around 95%-96% accuracy. If you scroll to the end of the readme, you will see that I reference your repo and I mentioned what I changed. I can see submit a pull request to your repo if you are interested. There are a few other things that I could add if I have the time. Like I could add the full attention layer mechanism (not the simplified version). I have that done on my computer, but it is not very pretty. We'll see. It works very well as is so far.

Let me know what you think if you have time.

Cheers!