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



    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))]
        return initial_states
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

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: scipy/scipy
Commit Name: 3b60554919507e818bf783b3dab6f944a8ef9282
Time: 2016-08-07
Author: endolith@gmail.com
File Name: scipy/signal/waveforms.py
Class Name:
Method Name: unit_impulse


Project Name: scikit-image/scikit-image
Commit Name: 7e4840bd9439d1dfb6beaf549998452c99f97fdd
Time: 2020-07-19
Author: wwymak@gmail.com
File Name: skimage/color/colorlabel.py
Class Name:
Method Name: _label2rgb_avg