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
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: |
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
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" |