Answers.Body: <p>I think U-Net is already a quite complex network that probably should (as of my experience) be able to approximate this multiplication. However this would still be an approximation that might not be accurate and maybe only solves a function that looks like a multiplication for the range of the shown input samples defined by your dataset (therefore potentially overfitting on your training dataset).</p>
  
  <p>So in general if you know that your target function does have this multiplication then you should definetly excplicitly enforce it in your network. If you know so much about the wanted function it's always better to build a good fitting architecture than using a general neural network architecture. That will ease the optimization and should generalize much better.</p>
  
  <p>However, it's hard or impossible to tell you for sure how much depth or complexity you need to solve this task within your wanted accuracy. Eventually you should just try it out.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-24T20:22:29.943Z
Answers.LastActivityDate: 2018-09-24T20:22:29.943Z
Answers.UserDisplayName: Marcel_marcel1991
Body: <p>Let's assume I want to teach a CNN some physics. Starting with a <a href="https://lmb.informatik.uni-freiburg.de/people/ronneber/u-net/" rel="nofollow noreferrer">U-Net</a>, I input images <code>A</code> and <code>B</code> as separate channels. I know that my target (produced by a very slow Monte-Carlo code) represents a signal such as <code>f(g(A) * h(B))</code>, where <code>f</code>, <code>g</code> and <code>h</code> are fairly "convolutional" operations -- meaning, involving mostly blurring and rescaling operations.</p>
  
  <p>I feel safe to state that this problem would not be too difficult for the case of <code>f(g(A) + h(B))</code> -- but what about <code>f(g(A) * h(B))</code>? Can I expect a basic CNN such as the U-Net to be able to represent the <code>*</code> (multiplication) operation?</p>
  
  <p>Or should I expect to be forced to include a <code>Multiply</code> layer in my network, somewhere where I expect that the part before can learn the <code>g</code> and <code>h</code> parts, and the part after can learn the <code>f</code> part?</p>
  
Tags: <convolutional-neural-networks>
Title: Can a basic CNN (Conv2D, MaxPooling2D, UpSampling2D) find a good approximation of a product of its input channels?
UserDisplayName: bers
ThreadText: # Can a basic CNN (Conv2D, MaxPooling2D, UpSampling2D) find a good approximation of a product of its input channels?
  
  (Asked by: username_0 on 2018-09-24)
  
  Let's assume I want to teach a CNN some physics. Starting with a [U-Net](https://lmb.informatik.uni-freiburg.de/people/ronneber/u-net/), I input images `A` and `B` as separate channels. I know that my target (produced by a very slow Monte-Carlo code) represents a signal such as `f(g(A) * h(B))`, where `f`, `g` and `h` are fairly "convolutional" operations -- meaning, involving mostly blurring and rescaling operations.
  
  I feel safe to state that this problem would not be too difficult for the case of `f(g(A) + h(B))` -- but what about `f(g(A) * h(B))`? Can I expect a basic CNN such as the U-Net to be able to represent the `*` (multiplication) operation?
  
  Or should I expect to be forced to include a `Multiply` layer in my network, somewhere where I expect that the part before can learn the `g` and `h` parts, and the part after can learn the `f` part?
  
  **Tags:** convolutional-neural-networks
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-09-24. Score: 2 | Accepted answer
  
  I think U-Net is already a quite complex network that probably should (as of my experience) be able to approximate this multiplication. However this would still be an approximation that might not be accurate and maybe only solves a function that looks like a multiplication for the range of the shown input samples defined by your dataset (therefore potentially overfitting on your training dataset).
  
  So in general if you know that your target function does have this multiplication then you should definetly excplicitly enforce it in your network. If you know so much about the wanted function it's always better to build a good fitting architecture than using a general neural network architecture. That will ease the optimization and should generalize much better.
  
  However, it's hard or impossible to tell you for sure how much depth or complexity you need to solve this task within your wanted accuracy. Eventually you should just try it out.
  
  
  ---
  
  