ee37cc5236f3a2435c02dfe13fa2d9a743aeef17,theanolm/network/softmaxlayer.py,SoftmaxLayer,create_structure,#SoftmaxLayer#,31

Before Change


        output_size = preact.shape[2]
        preact = preact.reshape([num_time_steps * num_sequences,
                                 output_size])
        self.output_probs = tensor.nnet.softmax(preact)
        self.output_probs = self.output_probs.reshape([num_time_steps,
                                                       num_sequences,
                                                       output_size])
        if self.network.mode.is_distribution():
            return

        // We should predict probabilities of the target outputs, i.e. the words
        // at the next time step.
        if self.network.mode.is_target_words():
            output_probs = self.output_probs
            target_class_ids = self.network.target_class_ids
        else:
            output_probs = self.output_probs[:-1]
            target_class_ids = self.network.class_input[1:]
            num_time_steps -= 1

        assert_op = tensor.opt.Assert(

After Change



        output_probs = self._get_softmax(layer_input)
        if not self.network.mode.is_target_words():
            output_probs = output_probs[:-1]
            target_class_ids = target_class_ids[1:]

        assert_op = tensor.opt.Assert(
            "Mismatch in mini-batch and target classes shape.")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: senarvi/theanolm
Commit Name: ee37cc5236f3a2435c02dfe13fa2d9a743aeef17
Time: 2016-09-22
Author: seppo.git@marjaniemi.com
File Name: theanolm/network/softmaxlayer.py
Class Name: SoftmaxLayer
Method Name: create_structure


Project Name: chainer/chainercv
Commit Name: 5173f180d75df1e751689d37692e729f45e416a6
Time: 2017-05-18
Author: yuyuniitani@gmail.com
File Name: chainercv/links/model/faster_rcnn/region_proposal_network.py
Class Name: RegionProposalNetwork
Method Name: __call__


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: ca7a5e9a39478054dbdfbfba9963b13c80b768f8
Time: 2018-03-14
Author: max.lapan@gmail.com
File Name: ch18/telegram-bot.py
Class Name: Session
Method Name: move_bot