MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / zero_state

Method zero_state

tensorflow/contrib/rnn/python/ops/rnn_cell.py:3742–3762  ·  view source on GitHub ↗
(self, batch_size, dtype)

Source from the content-addressed store, hash-verified

3740 return w
3741
3742 def zero_state(self, batch_size, dtype):
3743 read_vector_list = [
3744 array_ops.zeros([batch_size, self.memory_vector_dim])
3745 for _ in range(self.read_head_num)
3746 ]
3747
3748 w_list = [
3749 array_ops.zeros([batch_size, self.memory_size])
3750 for _ in range(self.read_head_num + self.write_head_num)
3751 ]
3752
3753 controller_init_state = self.controller.zero_state(batch_size, dtype)
3754
3755 M = array_ops.zeros([batch_size, self.memory_size, self.memory_vector_dim])
3756
3757 return NTMControllerState(
3758 controller_state=controller_init_state,
3759 read_vector_list=read_vector_list,
3760 w_list=w_list,
3761 M=M,
3762 time=0)
3763
3764
3765class MinimalRNNCell(rnn_cell_impl.LayerRNNCell):

Callers 15

testNTMCellMethod · 0.95
callMethod · 0.45
callMethod · 0.45
functional_rnnFunction · 0.45
_VerifyCheckpointMethod · 0.45
dict_to_state_tupleFunction · 0.45
_get_initial_statesFunction · 0.45
testConv1DLSTMCellMethod · 0.45
testConv2DLSTMCellMethod · 0.45
testConv3DLSTMCellMethod · 0.45

Calls 1

rangeFunction · 0.50

Tested by 9

testNTMCellMethod · 0.76
_VerifyCheckpointMethod · 0.36
testConv1DLSTMCellMethod · 0.36
testConv2DLSTMCellMethod · 0.36
testConv3DLSTMCellMethod · 0.36
testGLSTMCellMethod · 0.36
testGLSTMCellFailureMethod · 0.36