364948bf0bb46f9bc3809bbe0a63d09348994444,tests/complexGrads_test.py,,partition,#Any#Any#,26

Before Change


    max_free_energy = free_energies.max()

    f_reduced = free_energies - max_free_energy
    logZ = max_free_energy + f_reduced.exp().sum().log()
    return logZ.exp()


def probability(nn_state, v, Z):
    Evaluates the probability of the given vector(s) of visible

After Change


    // f_reduced = free_energies - max_free_energy
    // logZ = max_free_energy + f_reduced.exp().sum().log()
    // return logZ.exp()
    return torch.tensor(
        nn_state.rbm_am.compute_partition_function(visible_space),
        device=nn_state.device, dtype=torch.double
    )


def probability(nn_state, v, Z):
    Evaluates the probability of the given vector(s) of visible
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: PIQuIL/QuCumber
Commit Name: 364948bf0bb46f9bc3809bbe0a63d09348994444
Time: 2018-08-04
Author: emerali@users.noreply.github.com
File Name: tests/complexGrads_test.py
Class Name:
Method Name: partition


Project Name: PIQuIL/QuCumber
Commit Name: 364948bf0bb46f9bc3809bbe0a63d09348994444
Time: 2018-08-04
Author: emerali@users.noreply.github.com
File Name: tests/positiveGrads_test.py
Class Name:
Method Name: partition


Project Name: facebookresearch/Horizon
Commit Name: 69ee52aff61b9cda3d4ac874ab8b38ba0269c4c5
Time: 2020-07-17
Author: czxttkl@fb.com
File Name: reagent/training/ranking/seq2slate_trainer.py
Class Name: Seq2SlateTrainer
Method Name: train