This file contains hidden or 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/python3 | |
| import datetime | |
| import sys | |
| import math | |
| import numpy as np | |
| from argparse import ArgumentParser | |
| from collections import defaultdict | |
| from chainer import FunctionSet, Variable, functions, optimizers |
This file contains hidden or 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
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |
This file contains hidden or 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
| """ | |
| This is a batched LSTM forward and backward pass | |
| """ | |
| import numpy as np | |
| import code | |
| class LSTM: | |
| @staticmethod | |
| def init(input_size, hidden_size, fancy_forget_bias_init = 3): |
This file contains hidden or 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
| # Alec Radford, Indico, Kyle Kastner | |
| # License: MIT | |
| """ | |
| Convolutional VAE in a single file. | |
| Bringing in code from IndicoDataSolutions and Alec Radford (NewMu) | |
| Additionally converted to use default conv2d interface instead of explicit cuDNN | |
| """ | |
| import theano | |
| import theano.tensor as T | |
| from theano.compat.python2x import OrderedDict |
This file contains hidden or 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
| # Alec Radford, Indico, Kyle Kastner | |
| # License: MIT | |
| """ | |
| VAE in a single file. | |
| Bringing in code from IndicoDataSolutions and Alec Radford (NewMu) | |
| """ | |
| import theano | |
| import theano.tensor as T | |
| from theano.compat.python2x import OrderedDict | |
| from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams |