d3004d19c5cac8c13de9c18935c22843527f4947,pyprob/state.py,,sample,#Any#Any#Any#Any#,79

Before Change


                // The log_prob of samples are zero for regular importance sampling (no learned proposals) as it cancels out
                current_sample = Sample(address, distribution, value, log_prob=0, controlled=True)
            else:
                current_sample = Sample(address, distribution, value, log_prob=distribution.log_prob(value), controlled=True)

            if _trace_state == TraceState.RECORD_USE_INFERENCE_NETWORK:
                previous_sample = None
                if _current_trace.length > 0:

After Change


                global _current_trace_replaced_sample_proposal_distributions
                _current_trace_inference_network.eval()
                if replace:
                    if address not in _current_trace_replaced_sample_proposal_distributions:
                        _current_trace_replaced_sample_proposal_distributions[address] = _current_trace_inference_network.forward_one_time_step(_current_trace_previous_sample, current_sample)
                    proposal_distribution = _current_trace_replaced_sample_proposal_distributions[address]
                else:
                    proposal_distribution = _current_trace_inference_network.forward_one_time_step(_current_trace_previous_sample, current_sample)
                value = proposal_distribution.sample()[0]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pyprob/pyprob
Commit Name: d3004d19c5cac8c13de9c18935c22843527f4947
Time: 2018-03-06
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/state.py
Class Name:
Method Name: sample


Project Name: pyprob/pyprob
Commit Name: e3b5cf4b4146316f8a2d009118fab5369ebe59f6
Time: 2018-03-23
Author: michaeljteng@gmail.com
File Name: pyprob/state.py
Class Name:
Method Name: sample


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 25bd8661dd2764668d6851ffd54ad89fcb6a6cbf
Time: 2016-11-22
Author: yuyanting@google.com
File Name: perfkitbenchmarker/linux_benchmarks/blazemark_benchmark.py
Class Name:
Method Name: Run