yang-song / score_sde_pytorch

PyTorch implementation for Score-Based Generative Modeling through Stochastic Differential Equations (ICLR 2021, Oral)
https://arxiv.org/abs/2011.13456
Apache License 2.0
1.59k stars 294 forks source link

Question for inpaint #9

Open TLi347 opened 2 years ago

TLi347 commented 2 years ago

Hi Yang Song,

In 30 row, section "Inpaint", Score SDE demo PyTorch.ipynb,

should it be changed to x = pc_inpainter(score_model, scaler(img*mask), mask) so that it wouldn't inference img from img?

Please correct me if I misunderstand this part.

yang-song commented 2 years ago

It shouldn't affect the results. In pc_inpainter we use masks to make sure the network does not have access to extra knowledge.

phaigx commented 2 years ago

I find the img input is used in inpainting.Althougth the img input add noise,I think the img input can't be used in this place,the input img can't exist really. mask_data = masked_data_mean +torch.randn_like(x)*std[:,None,None,None]] .the mask_data_mean is equal to data(the img input) please correct me if my thoughts is error. sincerely

yang-song commented 2 years ago

I find the img input is used in inpainting.Althougth the img input add noise,I think the img input can't be used in this place,the input img can't exist really. mask_data = masked_data_mean +torch.randn_like(x)*std[:,None,None,None]] .the mask_data_mean is equal to data(the img input) please correct me if my thoughts is error. sincerely

The next line of code masks out the information in mask_data. As a result the inpainting algorithm does not know the ground truth.