Custom loss function with large matrix multiplication

Hi,

I am working with depth estimation from stereo images and am trying to use a custom loss function.

In the network, images are cropped into size [256 512] and the maximum disparity is set to 192. This will then give me an output. The loss function includes cross product([bs256512 192] [192 bs256512]), which will generate a massive matrix and requires a lot of memory.

Is there a way to get around this?

1 Like