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():
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)
// cost = -tensor.log(self.target_probs)
// cost -= minibatch_size * tensor.log(1.0 - self.negative_probs)
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: wenwei202/iss-rnns
Commit Name: b9b992e52fb42f137e6aa0de6e9f201ef0140571
Time: 2016-10-21
Author: seominjoon@gmail.com
File Name: basic/model.py
Class Name:
Method Name: bi_attention
Project Name: weinman/cnn_lstm_ctc_ocr
Commit Name: 0bf56c5e8db53e152e7095087499d072018283e6
Time: 2018-06-29
Author: am.lamsal@gmail.com
File Name: src/test.py
Class Name:
Method Name: model_fn