Coder Social home page Coder Social logo

philgookang / simple_bilstm_model Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 25.76 MB

A simple many-to-one string generating Bidirectional LSTM using pytorch

License: GNU General Public License v3.0

Python 100.00%
pytorch bilstm bidirectional-lstm lstm many-to-one

simple_bilstm_model's Introduction

Simple Bidirectional LSTM model

Genereate/predict a sentence using a Bidirectionl LSTM model.

Dependencies

For this simple code, we only need pytorch, numpy, and visdom. No other libraries required!
We use visdom to graph our loss value during training as seen in the picture below!

How To Use

1. Clone git

$ git clone https://github.com/philgookang/simple_bilstm_model.git
$ cd simple_bilstm_model

2. Train the model
To train the model yourself, run the following code. If you want to use a pretrained model, go direction to step 3.

$ python train.py

3. Test the model
To test the model, change the value for line 13 and run the following code.

$ python test.py

Loss graph

This is a picture of the loss value during training. While it may look very unclean, the dataset is only 20 sentences.
But it is converging if you look carefully! :) visdom training loss graph

simple_bilstm_model's People

Contributors

philgookang avatar

Watchers

 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.