Hi,
The dependent variable of the custom model is a 24-dimensional vector of continuous values that represent 6 bounding boxes (top, left, bottom right for each bounding box). In the loss function, I would like to compare the distances between the centroids of the represented bounding boxes. Thus, every batch item should be reshaped into 12-dimensional vector as every bounding box should be transformed into a point (y = (top + bottom)/2, x = (left + right)/2).
I tried to do the following:
input_boxes = list(map(lambda x: list(zip(*[x[i::4] for i in range(4)])), input))
input_points = list(map(lambda x: ((x[0] + x[2])/torch.Tensor(2), (x[1] + x[3])/torch.Tensor(2)), input_boxes))

This resulted an error: mul(): argument ‘other’ (position 1) must be Tensor, not tuple
Does anyone know how to reshape the batch properly?
Thank you!
Niko