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)
| 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 | """ |