73e563ecaf915d073d8b8fabc4a568ecddb0ea11,keras/layers/recurrent.py,Recurrent,get_initial_states,#Recurrent#Any#,122
Before Change
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
def get_initial_states(self, X):
// 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))]
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: keras-team/keras
Commit Name: abca83373d6d7df2747c5cdcc2bb7234395604e6
Time: 2016-02-24
Author: francois.chollet@gmail.com
File Name: keras/layers/recurrent.py
Class Name: GRU
Method Name: step
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