From 9b1020137828282c9ff738a5a9b2db4d0a364ace Mon Sep 17 00:00:00 2001 From: "Mao, Zhiyuan" Date: Tue, 8 Feb 2022 20:38:59 -0500 Subject: [PATCH] Update simulator.py --- simulator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simulator.py b/simulator.py index cd2299d..c3f9efb 100644 --- a/simulator.py +++ b/simulator.py @@ -77,7 +77,7 @@ def forward(self, img): MVx = torch.ifft((self.S_half*torch.randn(self.img_size,self.img_size,device=self.device)).permute(1,2,0),2) MVy = torch.ifft((self.S_half*torch.randn(self.img_size,self.img_size,device=self.device)).permute(1,2,0),2) - pos = torch.stack((MVx[:,:,0],MVy[:,:,1]),2) * self.const + pos = torch.stack((MVx[:,:,0],MVy[:,:,0]),2) * self.const flow = self.grid+pos flow = 2.0*flow / (self.img_size-1) - 1.0 out = F.grid_sample(out.view((1,-1,self.img_size,self.img_size)), flow, 'bilinear', padding_mode='border', align_corners=False).squeeze()