spyrit.core.torch.neumann_boundary
- spyrit.core.torch.neumann_boundary(img_shape)[source]
Creates a finite difference matrix of shape \((h*w,h*w)\) for a 2D image of shape \((h,w)\). The boundary condition used is Neumann.
- Args:
img_shape(tuple): The size of the image \((h,w)\).- Returns:
torch.tensor: The finite difference matrix.
Note
This function returns the same matrix as
finite_diff_mat()with the Neumann boundary condition. Internal implementation is different and allows to process rectangular images.