Answers.Body: <p>Yes, if you have 3 images (and by images I assume you mean samples) the flatten layer will be of the shape <span class="math-container">$12288*3$</span> (<span class="math-container">$64*64*3=12288$</span>). The size of <span class="math-container">$W$</span> however does not change, and nor does the size of <span class="math-container">$b$</span> as these are parameters and are independent of the amount of samples passed through the network.</p>
  <p>ETA: I only answered the &quot;Am I right?&quot; part of your question because that's the only part of your questions that's actually a question. I don't know what you're trying to ask in the second half of your question</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-25T06:54:34.690Z
Answers.Text: Thank you. Yes image means samples. In the second half my question I want to the input for W^T  and x. Is it W^T= [64,64,3,64,64,3,64,64,3] and x = [64,64,3,64,64,3,64,64,3]^T?
Answers.UserDisplayName: Encipher
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-25T06:37:44.403Z
Answers.LastActivityDate: 2020-09-25T06:37:44.403Z
Answers.UserDisplayName: Recessive
Body: <p>I have read a lecture note of Prof. Andrew Ng. There was something about data normalization like how can we flatten an image of (64x64x3) into a (64x64x3)*x1 vector. After that there is pictorial representation of flatten</p>
  <p><a href="https://i.sstatic.net/l8S4Q.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/l8S4Q.png" alt="enter image description here" /></a></p>
  <p>As per the picture height, length and width of the picture is 64 , 64, 3. I think nx is a row vector which is then transpose to a column vector. If there is 3 pictures I think nx contains {64,64,3,64,64,3,64,64,3}. Am I right?</p>
  <p>To use a 64x64x3 image as an input to our neuron, we need to flatten the image into a (64x64x3)x1 vector. And to make Wᵀx + b output a single value z, <strong>we need W to be a (64x64x3)x1 vector</strong>: <strong>(dimension of input)x(dimension of output), and b to be a single value.</strong> With N number of images, we can make a matrix X of shape (64x64x3)xN. WᵀX + b outputs Z of shape 1xN containing z’s for every single sample, and by passing Z through a sigmoid function we get final ŷ of shape 1xN that contains predictions for every single sample. We do not have to explicitly create a b of 1xN with the same value copied N times, thanks to Python broadcasting.</p>
  <p>As per my understanding, Wᵀ = nx and x= nxᵀ.</p>
  <p>Is it Wᵀ= [64,64,3,64,64,3,64,64,3] and x = [64,64,3,64,64,3,64,64,3]ᵀ?</p>
  <p>In that case there product will be a symmetry matrix.</p>
  <p>Is there any significance of symmetry matrix?</p>
  <p>I just messed up all the things while flatten the image. If anyone has any idea please share with me.</p>
  <p>Thank you in advance.</p>
  
Tags: <neural-networks><gradient-descent><thought-vectors><normalisation>
Title: Flatten image using Neural network and matrix transpose
UserDisplayName: Encipher
ThreadText: # Flatten image using Neural network and matrix transpose
  
  (Asked by: username_0 on 2020-09-25)
  
  I have read a lecture note of Prof. Andrew Ng. There was something about data normalization like how can we flatten an image of (64x64x3) into a (64x64x3)\*x1 vector. After that there is pictorial representation of flatten
  
  [![enter image description here](https://i.sstatic.net/l8S4Q.png)](https://i.sstatic.net/l8S4Q.png)
  
  As per the picture height, length and width of the picture is 64 , 64, 3. I think nx is a row vector which is then transpose to a column vector. If there is 3 pictures I think nx contains {64,64,3,64,64,3,64,64,3}. Am I right?
  
  To use a 64x64x3 image as an input to our neuron, we need to flatten the image into a (64x64x3)x1 vector. And to make Wᵀx + b output a single value z, **we need W to be a (64x64x3)x1 vector**: **(dimension of input)x(dimension of output), and b to be a single value.** With N number of images, we can make a matrix X of shape (64x64x3)xN. WᵀX + b outputs Z of shape 1xN containing z’s for every single sample, and by passing Z through a sigmoid function we get final ŷ of shape 1xN that contains predictions for every single sample. We do not have to explicitly create a b of 1xN with the same value copied N times, thanks to Python broadcasting.
  
  As per my understanding, Wᵀ = nx and x= nxᵀ.
  
  Is it Wᵀ= [64,64,3,64,64,3,64,64,3] and x = [64,64,3,64,64,3,64,64,3]ᵀ?
  
  In that case there product will be a symmetry matrix.
  
  Is there any significance of symmetry matrix?
  
  I just messed up all the things while flatten the image. If anyone has any idea please share with me.
  
  Thank you in advance.
  
  **Tags:** neural-networks, gradient-descent, thought-vectors, normalisation
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-09-25. Score: 1 | Accepted answer
  
  Yes, if you have 3 images (and by images I assume you mean samples) the flatten layer will be of the shape $12288\*3$ ($64\*64\*3=12288$). The size of $W$ however does not change, and nor does the size of $b$ as these are parameters and are independent of the amount of samples passed through the network.
  
  ETA: I only answered the "Am I right?" part of your question because that's the only part of your questions that's actually a question. I don't know what you're trying to ask in the second half of your question
  
  > **Comments:**
  > **username_0**: Thank you. Yes image means samples. In the second half my question I want to the input for W^T  and x. Is it W^T= [64,64,3,64,64,3,64,64,3] and x = [64,64,3,64,64,3,64,64,3]^T?  
  
  ---
  
  