title: CNTK: How to define UpSampling2D
body: <p>I'm wondering how to achieve UpSampling2D in CNTK. I cannot find such layer in the <a href="https://www.cntk.ai/pythondocs" rel="nofollow noreferrer">API</a>.</p>
  
  <p>UpSampling2D is an opposite operation of pooling layers, and expand the data by repeating the rows and columns of the data. Here's keras/tensorflow API for <a href="https://www.tensorflow.org/versions/r1.1/api_docs/python/tf/contrib/keras/layers/UpSampling2D" rel="nofollow noreferrer">UpSampling2D</a>.</p>
  
  <p>By looking at the <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/keras/python/keras/layers/convolutional.py#L1069" rel="nofollow noreferrer">tensorflow code</a>, they use <code>backend.resize_images</code> operation, but I cannot find resize operation in <a href="https://www.cntk.ai/pythondocs" rel="nofollow noreferrer">CNTK API</a> either.</p>
  
  <p><a href="https://i.stack.imgur.com/qrSaf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qrSaf.png" alt="UpSampling2D"></a></p>
  
  <h1>Answer 1 (From Frank)</h1>
  
  <p><a href="https://i.stack.imgur.com/Jnw3Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Jnw3Q.png" alt="enter image description here"></a></p>
  
  <h1>Answer 2 (From David)</h1>
  
  <p><a href="https://i.stack.imgur.com/C0TMS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C0TMS.png" alt="enter image description here"></a></p>
  
  <p><a href="https://www.quora.com/How-do-fully-convolutional-networks-upsample-their-coarse-output" rel="nofollow noreferrer">Picture from Quora: How do fully convolutional networks upsample their coarse output?</a></p>