Ok so I am stuck trying to figure out how to feed my targets for a multi target regression.

The data is loaded using a dataloader from a custom data class:

data = DataBunch(train_dl=train_dataloader, valid_dl=val_dataloader, device=torch.device(device))

The targets are coordinates within a bounding box of the format (batchsize, 2, 1) where each value corresponds to a coordinate eg:

tensor([[0.5244511366],

[0.4735262394]])

When I calculate the loss I get one value for each prediction a mean of both values. This causes the network to learn the centre of my bounding box which makes sense but is not really useful.

So the question is how can I calculate separate losses for each X and Y coordinate?

Any help in getting myself unstuck would be appreciated!