Conv layer for regression

username: MichaelMMeskhi
cooked: <p>Hello,</p>
<p>How would one go to initialize a Conv layer for a regression problem? Input is not an image. I would like to test out and see what kind of feature engineering a conv layer can perform. Say my input is 290 features and output is 1 value.</p>

username: tom
cooked: <aside class="quote no-group" data-username="MichaelMMeskhi" data-post="1" data-topic="97594">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/michaelmmeskhi/48/52095_2.png" class="avatar"> MichaelMMeskhi:</div>
<blockquote>
<p>Say my input is 290 features and output is 1 value.</p>
</blockquote>
</aside>
<p>Sounds more like a pooling layer or linear to me.</p>
<p>The defining feature of conv layers is shift invariance, but so when you only have 1 output, it is hard to intuit about shift invariance.<br>
That said, you could look into using the usual conv layer + pooling approach, just avoid doing softmax / sigmoid / … at the end if you want regression.</p>
<p>I would probably look at scaling weights such that activations so are in a sane range using trial and error.</p>
<p>Best regards</p>
<p>Thomas</p>

username: MichaelMMeskhi
cooked: <p>Hi Thomas, thank you for your feedback! I am working on 1 or 3 output regression problem. Of course, my data in scaled in preprocessing. My question is, how to deal with channels in Conv layers? Assuming my input shape is say (200, 300).</p>

username: tom
cooked: <p>Well, so what nature are these 200 by 300 inputs? Are they independent or is there some notion of <em>locality</em> in either dimension such that a thing and the thing next to it have more relation than the thing and the thing 100 places further? Do you expect your prediction to depend on the relation between them?</p>
<p>The things with locality should probably be treated as kernel dimensions similar to width and height of an image. Things without connection could either be more of “linear layer nature” (i.e. you consider all of them at once) or consider them indivdually (so you would have a kernel size of 1 in that dimension).</p>
<p>If you have locality in both directions, you could just use unsqueeze on the input to make it a single input channel.</p>
<p>Best regards</p>
<p>Thomas</p>

username: MichaelMMeskhi
cooked: <blockquote>
<p>is there some notion of  <em>locality</em>  in either dimension such that a thing and the thing next to it have more relation than the thing and the thing 100 places further?</p>
</blockquote>
<p>I am not too sure.</p>
<blockquote>
<p>Do you expect your prediction to depend on the relation between them?</p>
</blockquote>
<p>Yes, I believe there is but this is my goal, to prove there is such a relationship.</p>
<p>Ah I see. I will try to get it working and see if anything comes up.</p>
<p>Thank you Thomas,<br>
Michael</p>

username: tom
cooked: <p>I should say, just trying is cool, too. With audio people have found some success just treating mel spectrograms as images even though it can (and has been) argued that it’s not necessarily a good way to think about them.</p>

username: MichaelMMeskhi
cooked: <p>I see what you mean. I don’t know if I can treat my data in that way but you definitely gave me some things to think about.</p>