6b7ac72472c9d549dea45f35669e876c4c8ee2e9,arviz/data/io_pyro.py,PyroConverter,posterior_to_xarray,#PyroConverter#,50

Before Change


            }
        except AttributeError:  // Use pyro<0.3 release syntax
            data = {}
            for var_name in self.latent_vars:
                // pylint: disable=no-member
                samples = EmpiricalMarginal(
                    self.posterior, sites=var_name
                ).get_samples_and_weights()[0]
                samples = samples.numpy().squeeze()
                data[var_name] = utils.expand_dims(samples)
        return dict_to_dataset(data, library=self.pyro, coords=self.coords, dims=self.dims)

    def observed_data_to_xarray(self):
        Convert observed data to xarray.

After Change


    def posterior_to_xarray(self):
        Convert the posterior to an xarray dataset.
        data = self.posterior.get_samples(group_by_chain=True)
        data = {k: v.detach().cpu().numpy() for k, v in data.items()}
        return dict_to_dataset(data, library=self.pyro, coords=self.coords, dims=self.dims)

    @requires("posterior")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 3

Instances


Project Name: arviz-devs/arviz
Commit Name: 6b7ac72472c9d549dea45f35669e876c4c8ee2e9
Time: 2019-10-31
Author: fehiepsi@gmail.com
File Name: arviz/data/io_pyro.py
Class Name: PyroConverter
Method Name: posterior_to_xarray


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: 24387ddc838a9eb4273c03bf19e3f35587e3f201
Time: 2018-05-07
Author: eriklindernoren@live.se
File Name: implementations/wgan/wgan.py
Class Name:
Method Name:


Project Name: Microsoft/nni
Commit Name: ac6f420f224c331af8bda16edd9700e4cadea7e0
Time: 2019-12-11
Author: lanny@mail.hfut.edu.cn
File Name: src/sdk/pynni/nni/compression/torch/builtin_pruners.py
Class Name: FPGMPruner
Method Name: calc_mask


Project Name: ultralytics/yolov3
Commit Name: 1191dee71b0ef507bf4d95d2acfcc89555fb630c
Time: 2019-04-15
Author: glenn.jocher@ultralytics.com
File Name: utils/utils.py
Class Name:
Method Name: compute_loss


Project Name: uber/pyro
Commit Name: 296b28c1a5b1fb18732d1ed0f466b3761e50ebef
Time: 2019-11-14
Author: fehiepsi@gmail.com
File Name: pyro/contrib/gp/parameterized.py
Class Name: Parameterized
Method Name: autoguide