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
import numpy | |
import six | |
from chainer import cuda | |
from chainer import function | |
from chainer.utils import type_check | |
def _extract_gates(x): | |
r = x.reshape((x.shape[0], x.shape[1] / 3, 3) + x.shape[2:]) |
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
""" From: http://danielhnyk.cz/predicting-sequences-vectors-keras-using-rnn-lstm/ | |
and https://gist.github.com/hnykda/f1eca6cb0061cde701c2#file-keras-py | |
See comments on the blog at danielhnyk.cz. """ | |
from keras.models import Sequential | |
from keras.layers.core import TimeDistributedDense, Dense, Activation, Dropout | |
from keras.layers.recurrent import GRU, LSTM | |
import numpy as np | |
import datetime | |
import matplotlib.pyplot as plt | |
try: |