Git Product home page Git Product logo

lstm-poetry's Introduction

LSTM Poetry

This is the result of running a Long Short Term Memory (LSTM) Recurrent Neural Network (RNN) on a 26MB file of popular song lyrics. The training took about 30h on a GTX 960. Due to copyright restrictions, the input file is not provided, but you can download the trained weights to create some random "poetry".

Simply place the downloaded file in data/poet and run ./generate.py

Change the TEMPERATURE parameter in ./generate.py to vary the degree of randomness.

To train on your own input file,

  • place the content in the file input.txt
  • edit work_dir in config.py
  • run ./train.py

Installation

You will need TensorFlow (works on version 0.7.1 but not on earlier releases) and a few other python libs. To use the trained example, you don't need special hardware (e.g. a GPU), you can run TensorFlow on the CPU, but if you plan to train on your own input text, it will take forever without a GPU-accelerated hardware.

Examples

Here are some samples of what text can the network produce:

Input text: "A butterfly in "

A butterfly in the sun
Just because I know that I should leave this heart for you
You said I was falling apart

I wish I were you
I wanted you to know how I feel
I could have settled it all

It's time to go and do it big and you can be my side
I can't believe it when I see you
I'm lost in the world and I can't see you cry
I'm asking you to love me then let me go
I can't stop this way


A butterfly in the mirror
The world will find the soul and the truth
The stars are singing the songs
I want a holiday, I want you to stay away
I need you to stay away


A butterfly in the middle
To tell you that the life is safe

Have you seen the sun and the most of the guy

We are the spirit of the beast
The way that we started love
Let the sun shine on your face
We will hear you fall apart

lstm-poetry's People

Contributors

dvictor avatar

Watchers

James Cloos 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.