Giter Site home page Giter Site logo

tienthanhdhcn / char-embeddings Goto Github PK

View Code? Open in Web Editor NEW

This project forked from minimaxir/char-embeddings

0.0 1.0 0.0 10.95 MB

A repository containing 300D character embeddings derived from the GloVe 840B/300D dataset, and uses these embeddings to train a deep learning model to generate Magic: The Gathering cards using Keras

License: MIT License

Python 100.00%

char-embeddings's Introduction

char-embeddings

char-embeddings is a repository containing 300D character embeddings derived from the GloVe 840B/300D dataset, and uses these embeddings to train a deep learning model to generate Magic: The Gathering cards using Keras. The generation and model construction is heavily modified after the automatic text generation Keras example by François Chollet.

Usage

This repository contains a number of Python 3 scripts:

  • create_embeddings.py: Converts a pretrained word embeddings file into a character embeddings file by averaging the per-character vectors.
  • create_magic_text.py: Converts an MTG JSON card dump into a one-per-line card encoding.
  • text_generator_keras.py: Constructs and trains the Keras model, producing Magic cards at each epoch.
  • text_generator_keras_sample.py: Using the text file and Keras model generated from the previous two scripts, generate a large amount of Magic cards.

The output folder contains Magic card output at each epoch, a log of losses at every 50th batch, the learned character embeddings at the last epoch, the trained model itself, and a large sample of generated Magic cards.

Requirements

keras, tensorflow, h5py, scikit-learn

Maintainer

Max Woolf (@minimaxir)

License

MIT

char-embeddings's People

Contributors

minimaxir avatar

Watchers

 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.