catalyst-team / catalyst

Accelerated deep learning R&D
https://catalyst-team.com
Apache License 2.0
3.3k stars 388 forks source link

A question in CV - MNIST segmentation example #1389

Closed fjd330621 closed 2 years ago

fjd330621 commented 2 years ago

I'm new to this, so please forgive me if the question is silly. I'm a little confused about the last code in this short paragraph that why the self._target_key is also the x rather than y or maybe batch["targets"].

class CustomRunner(dl.SupervisedRunner):
    def handle_batch(self, batch):
        x = batch[self._input_key]
        x_noise = (x + torch.rand_like(x)).clamp_(0, 1)
        x_ = self.model(x_noise)
        self.batch = {self._input_key: x, self._output_key: x_, self._target_key: x}
github-actions[bot] commented 2 years ago

Hi! Thank you for your contribution! Please re-check all issue template checklists - unfilled issues would be closed automatically. And do not forget to join our slack for collaboration.

Scitator commented 2 years ago

hi, 🤔 this is a simple denoising segmentation example, so, there no target available Nevertheless, you are right, it should be something like

self.batch = {self._input_key: x_noise, self._output_key: x_, self._target_key: x}
fjd330621 commented 2 years ago

Oh, oh, oh, I see. Thank you very much