96483326d8e1bd7ba7d9368d8e7552ec19b27a74,keras/layers/recurrent.py,GRU,get_constants,#GRU#Any#Any#,419

Before Change



    def get_constants(self, X, train=False):
        nb_samples = K.shape(X)[0]
        if K._BACKEND == "tensorflow":
            nb_samples = int(nb_samples)
        retain_p_W = 1. - self.p_W
        retain_p_U = 1. - self.p_U
        if train and self.p_W > 0 and self.p_U > 0:
            B_W = K.random_binomial((3, nb_samples, self.input_dim), p=retain_p_W)

After Change



    def get_constants(self, X, train=False):
        nb_samples = K.shape(X)[0]
        if K._BACKEND == "tensorflow" and train and self.p_W > 0 and self.p_U > 0:
            if not self.input_shape[0]:
                raise Exception("For RNN dropout in tensorflow, a complete " +
                                "input_shape must be provided (including batch size).")
            nb_samples = self.input_shape[0]
        retain_p_W = 1. - self.p_W
        retain_p_U = 1. - self.p_U
        if train and self.p_W > 0 and self.p_U > 0:
            B_W = K.random_binomial((3, nb_samples, self.input_dim), p=retain_p_W)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 21

Instances


Project Name: keras-team/keras
Commit Name: 96483326d8e1bd7ba7d9368d8e7552ec19b27a74
Time: 2016-02-19
Author: yaringal@gmail.com
File Name: keras/layers/recurrent.py
Class Name: GRU
Method Name: get_constants


Project Name: keras-team/keras
Commit Name: 96483326d8e1bd7ba7d9368d8e7552ec19b27a74
Time: 2016-02-19
Author: yaringal@gmail.com
File Name: keras/layers/recurrent.py
Class Name: GRU
Method Name: get_constants


Project Name: keras-team/keras
Commit Name: 96483326d8e1bd7ba7d9368d8e7552ec19b27a74
Time: 2016-02-19
Author: yaringal@gmail.com
File Name: keras/layers/recurrent.py
Class Name: LSTM
Method Name: get_constants


Project Name: keras-team/keras
Commit Name: 96483326d8e1bd7ba7d9368d8e7552ec19b27a74
Time: 2016-02-19
Author: yaringal@gmail.com
File Name: keras/layers/recurrent.py
Class Name: SimpleRNN
Method Name: get_constants