Created
October 26, 2019 17:27
-
-
Save mbklein/6aebfa01c6e8a2d08afe7e7217517c28 to your computer and use it in GitHub Desktop.
Bare Bones Neural Net
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
import pathlib | |
import sys | |
from textgenrnn import textgenrnn | |
stem = sys.argv[1] | |
count = int(sys.argv[2]) | |
hdfile = f"{stem}.hdf5" | |
path = pathlib.Path(hdfile) | |
if path.exists(): | |
t = textgenrnn(hdfile) | |
else: | |
t = textgenrnn() | |
t.train_from_file(f"{stem}.txt", num_epochs=5) | |
t.generate(count, temperature=0.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment