MCPcopy Create free account
hub / github.com/DSL-Lab/GRBM / sampling

Method sampling

gmm.py:56–60  ·  view source on GitHub ↗
(self, num_samples)

Source from the content-addressed store, hash-verified

54
55 @torch.no_grad()
56 def sampling(self, num_samples):
57 m = torch.distributions.Categorical(self.w)
58 idx = m.sample((num_samples,))
59 return self.mu[idx, :] + torch.randn(num_samples, self.D).to(
60 self.w.device) * self.sigma[idx, :]
61
62 @torch.no_grad()
63 def langevin_sampling(self, x, num_steps=10, eta=1.0e+0, is_anneal=False):

Callers 2

visualize_samplingFunction · 0.45
create_datasetFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected