73e563ecaf915d073d8b8fabc4a568ecddb0ea11,keras/layers/recurrent.py,Recurrent,get_initial_states,#Recurrent#Any#,122
Before Change
def get_initial_states(self, X):
// build an all-zero tensor of shape (samples, output_dim)
initial_state = K.zeros_like(X) // (samples, timesteps, input_dim)
initial_state = K.sum(initial_state, axis=1) // (samples, input_dim)
reducer = K.zeros((self.input_dim, self.output_dim))
initial_state = K.dot(initial_state, reducer) // (samples, output_dim)
initial_states = [initial_state for _ in range(len(self.states))]
return initial_states
After Change
// build an all-zero tensor of shape (samples, output_dim)
initial_state = X[:, 0, 0] * 0 // (samples, )
initial_state = K.pack([initial_state] * self.output_dim) // (output_dim, samples)
initial_state = K.permute_dimensions(initial_state, (1, 0)) // (samples, output_dim)
initial_states = [initial_state for _ in range(len(self.states))]
return initial_states
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: keras-team/keras
Commit Name: 73e563ecaf915d073d8b8fabc4a568ecddb0ea11
Time: 2016-02-25
Author: farizrahman4u@gmail.com
File Name: keras/layers/recurrent.py
Class Name: Recurrent
Method Name: get_initial_states
Project Name: GPflow/GPflow
Commit Name: 82779a785e66d6949cd2a66a68e57757ba2f6bf1
Time: 2016-01-14
Author: james.hensman@gmail.com
File Name: GPflow/conditionals.py
Class Name:
Method Name: gp_predict_whitened
Project Name: shenweichen/DeepCTR
Commit Name: 3da641f3841d0cbb55543e691d4a2be1ca4102b7
Time: 2018-11-28
Author: last.fantasy@qq.com
File Name: deepctr/layers.py
Class Name: CrossNet
Method Name: call