Loss and other issues

farhanrahman: <p>Hello,</p>
<p>I am sorry if this sounds very naive, I am still new to PyTorch and working my way around. I am doing a project in which I have generated multi view synthetic images. These images are of 3 channels and 1000 by 1000. As ground truth I have a 12 channel mask. So essentially my ground truth dimension for a single image is 1000x1000x12. Each pixel has a vector of 12 float values where these values indicate certain properties. So this is not a classification problem but can be thought of as regression. Also I dont want probablities, rather the raw values of each channel since they carry meaning with their values.</p>
<p>I am trying to run the Unet architecture to see how it goes by and make changes and modifications slowly along the way. I am using 12 output channels at the final layer. However I am not sure if this is the right approach. Also I have read about the BCEWITHLOGITSLOSS, and I think it is the most fitting loss function in this context. Am I going in the right track? Also I have two 1080s. However to run this, even with a batch size of 1 I am getting CudaOutOfMemory, sorry if this information is irrelevant here. My main questions are, is this architecture worth experimenting for the scope of my work, and also my decision of using 12 channels at the final layer? Also is my loss function appropriate, or is there anything better that I should begin with?</p>
<p>Your comments and suggestions will be really appreciated. Thanks!</p>

KFrank: <p>Hi Farhan!</p>
<aside class="quote no-group quote-modified" data-username="farhanrahman" data-post="1" data-topic="67571" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/f/3d9bf3/48.png" class="avatar"> farhanrahman:</div>
<blockquote>
<p>So essentially my ground truth dimension for a single image is 1000x1000x12. Each pixel has a vector of 12 float values where these values indicate certain properties. So this is not a classification problem but can be thought of as regression.</p>
<p>…</p>
<p>I am using 12 output channels at the final layer.</p>
</blockquote>
</aside>
<p>I assume that you mean you have 12 output channels <em>per pixel</em> in<br>
the final layer.  Otherwise I don’t understand what you are doing.</p>
<aside class="quote no-group">
<blockquote>
<p>Also I have read about the BCEWITHLOGITSLOSS, and I think it is the most fitting loss function in this context.</p>
</blockquote>
</aside>
<p>Given that you understand this to be similar to a regression,<br>
<code>MSELoss</code> (mean-squared error) would be the appropriate loss<br>
function.</p>
<p>(I can’t comment on Unet nor your CudaOutOfMemory error.)</p>
<p>Best.</p>
<p>K. Frank</p>

farhanrahman: <p>Hey Frank,</p>
<p>Thanks for commenting!</p>
<p>Yes I do have 12 values for each pixel, which is in each channel. However these are continuous<br>
values on a range of [0-1].</p>
<p>*Edit : Also, yes that is what I meant, as in, my output would be a 1000x1000x12 mask. 12 corresponding to the properties I mentioned for each pixel, where each value can range between [0-1].</p>