d8f8ac953bc290739aa32a0ad277d53820d4473a,pyprob/modules.py,ProposalUniformDiscrete,loss,#ProposalUniformDiscrete#Any#Any#,77

Before Change


        for b in range(batch_size):
            value = samples[b].value[0]
            min = samples[b].distribution.prior_min
            l -= log_weights[b, int(value) - min] // Should we average this over dimensions? See http://pytorch.org/docs/nn.html//torch.nn.KLDivLoss
        return l

class ProposalNormal(nn.Module):

After Change


        log_weights = torch.log(proposal_output + util.epsilon)
        l = 0
        for b in range(batch_size):
            value = Variable(samples[b].value, requires_grad=False) // value is one-hot
            l -= torch.sum(log_weights[b] * value) // Should we average this over dimensions? See http://pytorch.org/docs/nn.html//torch.nn.KLDivLoss
        return l

class ProposalNormal(nn.Module):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: pyprob/pyprob
Commit Name: d8f8ac953bc290739aa32a0ad277d53820d4473a
Time: 2017-08-05
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/modules.py
Class Name: ProposalUniformDiscrete
Method Name: loss


Project Name: silvandeleemput/memcnn
Commit Name: 98e790696877d8065842d83f1819ae9c989a8c98
Time: 2018-06-06
Author: sil.vandeleemput@radboudumc.nl
File Name: memcnn/models/revop.py
Class Name: ReversibleBlockFunction
Method Name: backward


Project Name: vinhkhuc/PyTorch-Mini-Tutorials
Commit Name: 713df9556d874cf9ede91563fccb746b8c54c35f
Time: 2017-05-24
Author: knvinh@gmail.com
File Name: 6_lstm.py
Class Name:
Method Name: predict