Git Product home page Git Product logo

character-level-language-model-dinosaurus-island's Introduction

Character-level-language-model-Dinosaurus-Island

The code is in Python 3

Model Overview

  • Initialize parameters

  • Run the optimization loop

    • Forward propagation to compute the loss function
    • Backward propagation to compute the gradients with respect to the loss function
    • Clip the gradients to avoid exploding gradients
    • Using the gradients, update your parameters with the gradient descent update rule.
  • Return the learned parameters

  • At each time-step, the RNN tries to predict what is the next character given the previous characters.

  • The dataset X=(x⟨1⟩,x⟨2⟩,...,x⟨Tx⟩) is a list of characters in the training set.

  • Y=(y⟨1⟩,y⟨2⟩,...,y⟨Tx⟩) is the same list of characters but shifted one character forward.

  • At every time-step t, y⟨t⟩=x⟨t+1⟩. The prediction at time t is the same as the input at time t+1.

model

Sampling

I used Sampling to generate new names, as shown in the figure .

sample

We assume the model is trained and paas a dummy vector as input and generate a new name based on the parameters learned by the RNN.

How to Run

The model is already implemented in model.py, just run it on command line

  • Output The code outputs a set of names on every 2000th optimization loop along with the loss.
    • sample output

       Iteration: 34000, Loss: 22.447230
      
        Onyxipaledisons
        Kiabaeropa
        Lussiamang
        Pacaeptabalsaurus
        Xosalong
        Eiacoteg
        Troia
      

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.