Code Monkey home page Code Monkey logo

lstm_generator's Introduction

LSTM Text Generator

This code implements a configurable LSTM to generate text similiar to a set you train it on.

Requirements

You need any version of python with numpy and keras installed. Note that for keras to work you need to either install tensorflow or theano or CTNK.

Configure the config.py file to suit your needs and provide a dataset under the name input.txt (changable in the configs).

If there is a model file, the neural network will continue working on that, otherwise it will start from scratch. In order to change the structure of the machine you need to clear out the old model file.

Run textgen.py to train the model and run run.py in order to print out samples based on the trained model.

Note on stateful machines

As of this version, stateful machines must run with batch size 1. This makes each iteration very slow. Sorry for that!

TODO

  • Save the iteration for the model, so that when resumed, it would continue counting and not reset to 1.
  • Save the model name based on the input file
  • Write a better Readme
  • Write better normalizer
  • Provide some sample datasets
  • Write more TODOs

lstm_generator's People

Contributors

mcsh avatar

Watchers

Mostafa Ahangarha 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.