Update the state with extracted features. Args: imgs: tensor with images feed to the feature extractor real: bool indicating if ``imgs`` belong to the real or the fake distribution
(self, imgs: Tensor, real: bool)
| 231 | self.add_state("fake_features", [], dist_reduce_fx=None) |
| 232 | |
| 233 | def update(self, imgs: Tensor, real: bool) -> None: # type: ignore |
| 234 | """Update the state with extracted features. |
| 235 | |
| 236 | Args: |
| 237 | imgs: tensor with images feed to the feature extractor |
| 238 | real: bool indicating if ``imgs`` belong to the real or the fake distribution |
| 239 | """ |
| 240 | features = self.inception(imgs) |
| 241 | |
| 242 | if real: |
| 243 | self.real_features.append(features) |
| 244 | else: |
| 245 | self.fake_features.append(features) |
| 246 | |
| 247 | def compute(self) -> Tuple[Tensor, Tensor]: |
| 248 | """Calculate KID score based on accumulated extracted features from the two distributions. Returns a tuple |
nothing calls this directly
no outgoing calls
no test coverage detected