Skip to content

Commit 9912e9b

Browse files
committed
README initial
1 parent 2f8ed2b commit 9912e9b

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# char-embeddings
2+
![](char-tsne-embed.png)
3+
4+
**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](https://keras.io/). The generation and model construction is heavily modified after the [automatic text generation](https://github.com/fchollet/keras/blob/master/examples/lstm_text_generation.py) Keras example by [François Chollet](https://twitter.com/fchollet).
5+
6+
## Usage
7+
8+
This repository contains a number of Python 3 scripts:
9+
10+
- `create_embeddings.py`: Converts a pretrained word embeddings file into a character embeddings file by averaging the per-character vectors.
11+
- `create_magic_text.py`: Converts an MTG JSON card dump into a one-per-line card encoding.
12+
- `text_generator_keras.py`: Constructs and trains the Keras model, producing Magic cards at each epoch.
13+
- `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.
14+
15+
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.
16+
17+
## Requirements
18+
keras, tensorflow, h5py, scikit-learn
19+
20+
## Maintainer
21+
Max Woolf ([@minimaxir](http://minimaxir.com))
22+
23+
## License
24+
MIT

char-tsne-embed.png

143 KB
Loading

0 commit comments

Comments
 (0)