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

Before Change


        num_time_steps = preact.shape[0]
        num_sequences = preact.shape[1]
        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():

After Change


            // Generate one word for each training word as a negative sample.
            sample_class_ids = self.random.uniform(self.target_probs.shape)
            sample_class_ids *= num_classes
            sample_class_ids = tensor.cast(sample_class_ids, "int64")
            self.negative_probs = self._get_sigmoid(layer_input,
                                                    sample_class_ids)
            // minibatch_size = self.negative_probs.shape[0] * self.negative_probs.shape[1]
            // minibatch_size = tensor.cast(minibatch_size, theano.config.floatX)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

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: dmlc/gluon-nlp
Commit Name: 75c29a3518ee42b98cc651b6922cbae85d2e961e
Time: 2020-02-07
Author: linhaibin.eric@gmail.com
File Name: src/gluonnlp/model/bert.py
Class Name: BERTEncoder
Method Name: hybrid_forward


Project Name: dmlc/gluon-nlp
Commit Name: e88d55e77e55b8e562881ed9d12160053810961b
Time: 2020-01-24
Author: linhaibin.eric@gmail.com
File Name: src/gluonnlp/model/bert.py
Class Name: BERTEncoder
Method Name: hybrid_forward