INNER CODE UNIT · Python
BNLSTMCell
ematvey/hierarchical-attention-networks · bn_lstm.py:53
class BNLSTMCell(RNNCell):
"""Batch normalized LSTM as described in http://arxiv.org/abs/1603.09025"""
def __init__(self, num_units, training):
self.num_units = num_units
self.training = training
@property
def state_size(self):
return (self.num_units, self.num_units)
@property
def output_size(self):
return self.num_units
def __call__(self, x, state, scope=None):
with tf.variable_scope(scope or 'bn_lstm'):
c, h = state