e822a02daa1cd1c42f6d2bf309d5996a21979ef1,qucumber/tests/test_grads_positive.py,,algorithmic_gradKL,#Any#Any#Any#,75

Before Change


    Z = partition(nn_state,vis)
    for i in range(len(vis)):
        for rbmType in nn_state.gradient(vis[i]):
            for pars in nn_state.gradient(vis[i])[rbmType]:
                grad_KL[rbmType][pars] += ((target_psi[i,0])**2)*nn_state.gradient(vis[i])[rbmType][pars]            
                grad_KL[rbmType][pars] -= probability(nn_state,vis[i], Z)*nn_state.gradient(vis[i])[rbmType][pars]
    return grad_KL            

def algorithmic_gradNLL(qr,data,k):
    qr.nn_state.set_visible_layer(data)

After Change


    grad_KL = torch.zeros(nn_state.rbm_am.num_pars,dtype=torch.double)
    for i in range(len(vis)):
        grad_KL += ((target_psi[i,0])**2)*nn_state.gradient(vis[i]) 
        grad_KL -=probability(nn_state,vis[i], Z)*nn_state.gradient(vis[i])
        //for rbmType in nn_state.gradient(vis[i]):
        //    for pars in nn_state.gradient(vis[i])[rbmType]:
        //        grad_KL[rbmType][pars] += ((target_psi[i,0])**2)*nn_state.gradient(vis[i])[rbmType][pars]            
        //        grad_KL[rbmType][pars] -= probability(nn_state,vis[i], Z)*nn_state.gradient(vis[i])[rbmType][pars]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: PIQuIL/QuCumber
Commit Name: e822a02daa1cd1c42f6d2bf309d5996a21979ef1
Time: 2018-07-31
Author: gtorlai@uwaterloo.ca
File Name: qucumber/tests/test_grads_positive.py
Class Name:
Method Name: algorithmic_gradKL


Project Name: PIQuIL/QuCumber
Commit Name: b11d724e27ce608da0b38565f2a697b1da98d799
Time: 2018-07-29
Author: gtorlai@uwaterloo.ca
File Name: qucumber/quantum_reconstruction.py
Class Name: QuantumReconstruction
Method Name: compute_batch_gradients


Project Name: PIQuIL/QuCumber
Commit Name: 6aba6ab3264e8ecd7bdb7b46059480d0eb1ecca4
Time: 2018-07-26
Author: gtorlai@uwaterloo.ca
File Name: qucumber/quantum_reconstruction.py
Class Name: QuantumReconstruction
Method Name: compute_batch_gradients