Skip to content

Commit

Permalink
Update simulator.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mao114 authored Feb 9, 2022
1 parent eb34ec6 commit 9b10201
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 9b10201

Please sign in to comment.