def __init__(self, units,
n_slots=50,
m_depth=20,
shift_range=3,
controller_model=None,
read_heads=1,
write_heads=1,
activation='sigmoid',
batch_size=777,
stateful=False,
**kwargs):
self.output_dim = units
self.units = units
self.n_slots = n_slots
self.m_depth = m_depth
self.shift_range = shift_range
self.controller = controller_model
self.activation = get_activations(activation)
self.read_heads = read_heads
self.write_heads = write_heads
self.batch_size = batch_size
# self.return_sequence = True
try:
if controller.state.stateful:
self.controller_with_state = True
except:
self.controller_with_state = False
self.controller_read_head_emitting_dim = _controller_read_head_emitting_dim(m_depth, shift_range)
self.controller_write_head_emitting_dim = _controller_write_head_emitting_dim(m_depth, shift_range)
super(NeuralTuringMachine, self).__init__(**kwargs)
评论列表
文章目录