Skip to content

Instantly share code, notes, and snippets.

View mpariente's full-sized avatar
🤩

Pariente Manuel mpariente

🤩
View GitHub Profile
@mpariente
mpariente / bidirectional_LSTM.py
Last active December 19, 2017 22:12
Creating a child of Bidirectional to handle return_states
# In answer to this issue
# https://github.com/keras-team/keras/issues/8823
from keras import backend as K
from keras.layers import Bidirectional
from keras.utils.generic_utils import has_arg
from keras.layers import Input, LSTM
class MyBidirectional(Bidirectional):
"""
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):