47ed18a3af8be20dce91286a331d4671074ee0ca,keras/layers/recurrent.py,LSTM,build,#LSTM#,398
Before Change
def build(self):
input_dim = self.input_shape[2]
self.input = T.tensor3()
self.W_i = self.init((input_dim, self.output_dim))
self.U_i = self.inner_init((self.output_dim, self.output_dim))
self.b_i = shared_zeros((self.output_dim))
After Change
def build(self):
input_shape = self.input_shape
input_dim = input_shape[2]
self.input_dim = input_dim
self.input = K.placeholder(input_shape)
if self.stateful:
if not input_shape[0]:
raise Exception("If a RNN is stateful, a complete " +
"input_shape must be provided " +
"(including batch size).")
self.states = [K.zeros(input_shape[0], self.output_dim),
K.zeros(input_shape[0], self.output_dim)]
else:
// initial states: 2 all-zero tensor of shape (output_dim)
self.states = [None, None]
self.W_i = self.init((input_dim, self.output_dim))
self.U_i = self.inner_init((self.output_dim, self.output_dim))
self.b_i = K.zeros((self.output_dim))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 24
Instances
Project Name: keras-team/keras
Commit Name: 47ed18a3af8be20dce91286a331d4671074ee0ca
Time: 2015-11-26
Author: francois.chollet@gmail.com
File Name: keras/layers/recurrent.py
Class Name: LSTM
Method Name: build
Project Name: keras-team/keras
Commit Name: 47ed18a3af8be20dce91286a331d4671074ee0ca
Time: 2015-11-26
Author: francois.chollet@gmail.com
File Name: keras/layers/recurrent.py
Class Name: SimpleRNN
Method Name: build
Project Name: keras-team/keras
Commit Name: 47ed18a3af8be20dce91286a331d4671074ee0ca
Time: 2015-11-26
Author: francois.chollet@gmail.com
File Name: keras/layers/recurrent.py
Class Name: GRU
Method Name: build
Project Name: keras-team/keras
Commit Name: 47ed18a3af8be20dce91286a331d4671074ee0ca
Time: 2015-11-26
Author: francois.chollet@gmail.com
File Name: keras/layers/recurrent.py
Class Name: LSTM
Method Name: build