GithubHelp home page GithubHelp logo

char-rnn-java's Introduction

char-rnn-java

Multi-layer vanilla RNN for predicting the next character in a sequence.

Based on

Why

Made as as a term project for an OOP course. The requirements were to use Java, and no external libraries.

Main functionality

  • training - takes UTF-8 text as input, trains a model
  • snapshots - saves the network state to file every now and then
  • sampling - once trained, it can generate similar text by repeatedly predicting the next character

Datasets

Notes

I tested it mainly on the full Shakespeare dataset (4.6MB).

  • A 2 layer network with hidden size around 100 seems to generate the best results.
  • Increasing hidden size any more than that, or adding more layers, generally makes the network fail to adapt very well.
  • Decreasing the sampling temperature to around 0.8 causes the net to make safer predictions, but also generate some overlong sentences.
  • You could probably try to mitigate some of this, but, after all, it is just a vanilla RNN. Using a more sophisticated architecture like an LSTM is a must, if you want to generate results that are actually good.
  • Still, I like that for a simple model it does quite well. Sometimes it manages to capture the way of speaking of Shakespeare's characters, using very few actual words. Some of the generated names are also pretty elaborate.

LIMON SLUMENLUN SENCENSO:
Yee, take mece it a dold's make a slave
And thing, bear, I may pleast
Why in dulow witn ming!

License

Copyright (c) 2017 Matt Garstka, MIT License

char-rnn-java's People

Contributors

garstka avatar

Stargazers

alex qian avatar BestJex avatar Jinwei Liu avatar Evan Knowles avatar  avatar Dee avatar Sean Barbeau avatar

Watchers

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