Forked from Jenn olsen's Pen DxhpK.
A Pen by Saumil Shah on CodePen.
""" | |
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) |
class myNNUnwrapper(): | |
def __init__(self, inputTensor, nnModules, nnParams, verbose=False): | |
self.inputTensor = inputTensor | |
self.nnModules, self.nnParams = nnModules, nnParams | |
self.verbose = verbose | |
self.resolveAll() | |
Ää | |
l¸úF˘ j®P.ÄMÈ.Ä}q(Uprotocol_versionqMÈU | |
type_sizesq}q(UintqKUshortqKUlongqKuU | |
little_endianqàu.Äccollections | |
OrderedDict | |
q]q(]q(Uconv1.weightqctorch._utils | |
_rebuild_tensor | |
q((Ustorageqctorch | |
FloatStorage | |
qU94641065704928qUcuda:0q ä NtQK (ä ääät(äääättRq |
{ | |
"0": "tench, Tinca tinca", | |
"1": "goldfish, Carassius auratus", | |
"2": "great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias", | |
"3": "tiger shark, Galeocerdo cuvieri", | |
"4": "hammerhead, hammerhead shark", | |
"5": "electric ray, crampfish, numbfish, torpedo", | |
"6": "stingray", | |
"7": "cock", | |
"8": "hen", |
Forked from Jenn olsen's Pen DxhpK.
A Pen by Saumil Shah on CodePen.