a636431f9374bb9ae6e3a8107549bf20f91cdb1b,theanolm/network/samplingoutputlayer.py,SamplingOutputLayer,_get_target_preact,#SamplingOutputLayer#Any#Any#,96

Before Change


        target_class_ids = target_class_ids.flatten()
        weight = weight.T
        weight = weight[target_class_ids, :]
        weight = weight.reshape([minibatch_size, -1, input_size])
        // For some reason if we select elements from a vector, it will use
        // GpuAdvancedIncSubtensor1 and be slow. If bias is a matrix, it will
        // use the faster GpuAdvancedIncSubtensor1_dev20.
        bias = bias[:, None]
        bias = bias[target_class_ids, 0]
//        bias = bias[target_class_ids]
        bias = bias.reshape([minibatch_size, -1])

        result = (layer_input * weight).sum(2) + bias
        return result.reshape([num_time_steps, num_sequences, -1])

    def _get_target_list_preact(self, layer_input, target_class_ids):
        Structures the preactivations for a list of target classes.

After Change


        bias = bias[:, None]
        bias = bias[target_class_ids, 0]
//        bias = bias[target_class_ids]
        return (layer_input[:, :, None, :] * weight).sum(3) + bias

    def _get_target_list_preact(self, layer_input, target_class_ids):
        Structures the preactivations for a list of target classes.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: senarvi/theanolm
Commit Name: a636431f9374bb9ae6e3a8107549bf20f91cdb1b
Time: 2016-11-20
Author: seppo.git@marjaniemi.com
File Name: theanolm/network/samplingoutputlayer.py
Class Name: SamplingOutputLayer
Method Name: _get_target_preact


Project Name: SPFlow/SPFlow
Commit Name: 2333ea6770a94549f56f4c9c0a7a57d076b98eed
Time: 2018-11-19
Author: claas@voelcker.net
File Name: src/spn/algorithms/stats/Moments.py
Class Name:
Method Name: sum_moment


Project Name: tensorflow/agents
Commit Name: 982db1e3e4097b2fa2727bddf05307633dd6df83
Time: 2020-03-12
Author: no-reply@google.com
File Name: tf_agents/bandits/agents/utils.py
Class Name:
Method Name: build_laplacian_over_ordinal_integer_actions


Project Name: keras-team/keras
Commit Name: 45a10bc6d708fade197a37bfbc62312caf70e6a7
Time: 2017-02-17
Author: francois.chollet@gmail.com
File Name: keras/layers/convolutional_recurrent.py
Class Name: ConvLSTM2D
Method Name: get_constants