Differentiable image indexing - PyTorch Forums
discuss.pytorch.org › t › differentiable-imageFeb 07, 2021 · I’m working on a neural network to predict an aperture which is rotating. The output values are the machine parameters of this aperture, but for calculating the loss, I translate these to an image in order to calculate a effective targeted 3D volume. Unfortunately, my algorithm for creating these images is not differentiable and I do not obtain any gradients for these. Depending on the ...
Differentiable Indexing - autograd - PyTorch Forums
discuss.pytorch.org › t › differentiable-indexingMay 07, 2018 · I want to do something like this, but I need it be be differentiable w.r.t the index-tensors. is there any possibility to achieve this? import torch # initialize tensor tensor = torch.zeros((1, 400, 400)).double() tensor.requires_grad_(True) # create index ranges x_range = torch.arange(150, 250).double() x_range.requires_grad_(True) y_range = torch.arange(150, 250).double() y_range.requires ...
torch.index_select — PyTorch 1.10.1 documentation
pytorch.org › docs › stabletorch.index_select(input, dim, index, *, out=None) → Tensor. Returns a new tensor which indexes the input tensor along dimension dim using the entries in index which is a LongTensor. The returned tensor has the same number of dimensions as the original tensor ( input ). The dim th dimension has the same size as the length of index; other ...