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)
| 164 | 'DIP_Loss':dip_loss} |
| 165 | |
| 166 | def sample(self, |
| 167 | num_samples:int, |
| 168 | current_device: int, **kwargs) -> Tensor: |
| 169 | """ |
| 170 | Samples from the latent space and return the corresponding |
| 171 | image space map. |
| 172 | :param num_samples: (Int) Number of samples |
| 173 | :param current_device: (Int) Device to run the model |
| 174 | :return: (Tensor) |
| 175 | """ |
| 176 | z = torch.randn(num_samples, |
| 177 | self.latent_dim) |
| 178 | |
| 179 | z = z.to(current_device) |
| 180 | |
| 181 | samples = self.decode(z) |
| 182 | return samples |
| 183 | |
| 184 | def generate(self, x: Tensor, **kwargs) -> Tensor: |
| 185 | """ |