Skip to content

Instantly share code, notes, and snippets.

@simonnanty
simonnanty / minimalRNN.py
Last active May 5, 2018 09:08
Implementation of Minimal RNN [M. Chen, 2017]
import tensorflow as tf
from tensorflow.python.ops import math_ops, init_ops
from tensorflow.python.ops.rnn_cell_impl import RNNCell, _linear
class MinimalRNNCell(RNNCell):
"""Minimal RNN where Phi is a multi-layer perceptron.
This implementation is based on:
Minmin Chen (2017)
"MinimalRNN: Toward More Interpretable and Trainable Recurrent Neural Networks"
@simonnanty
simonnanty / LRUCell.py
Created October 10, 2017 07:18
A TensorFlow implementation of Lattice Recurrent Unit (LRU) from arXiv:1710.02254v1.
import tensorflow as tf
from tensorflow.python.ops import init_ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops.rnn_cell_impl import RNNCell, _linear
class LRUCell(RNNCell):
"""Lattice Recurrent Unit (LRU).
This implementation is based on: