MCPcopy Create free account
hub / github.com/KeepTryingTo/Pytorch-GAN / sample

Method sample

PyTorch-VAE/models/fvae.py:203–219  ·  view source on GitHub ↗

Samples from the latent space and return the corresponding image space map. :param num_samples: (Int) Number of samples :param current_device: (Int) Device to run the model :return: (Tensor)

(self,
               num_samples:int,
               current_device: int, **kwargs)

Source from the content-addressed store, hash-verified

201 'D_TC_Loss':D_tc_loss}
202
203 def sample(self,
204 num_samples:int,
205 current_device: int, **kwargs) -> Tensor:
206 """
207 Samples from the latent space and return the corresponding
208 image space map.
209 :param num_samples: (Int) Number of samples
210 :param current_device: (Int) Device to run the model
211 :return: (Tensor)
212 """
213 z = torch.randn(num_samples,
214 self.latent_dim)
215
216 z = z.to(current_device)
217
218 samples = self.decode(z)
219 return samples
220
221 def generate(self, x: Tensor, **kwargs) -> Tensor:
222 """

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.95

Tested by

no test coverage detected