Answers.Body: <p>You could use a CNN or Fully Connected Network and output a matrix of size 8*2*2. The first 8*2 matrix is the real number and the second is the imaginary number. Example code below uses keras.</p>
  
  <pre><code>'''
  input: numpy array of shape(batch_size,input_dim_0,input_dim_1,1)
  Y: keras tensor of shape(batch_size,8,2,2)
  
  '''
  
  model = Sequential()
  model.add(Conv2d(64,3,input_dim =(input_dim_0,input_dim_1,1))
  model.add(Conv2d(64,3)
  model.add(Conv2d(2,3)
  
  model.compile(loss='MSE',metrixs=['accuracy'])
  model.fit(input,Y)
  
  
  
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-02T22:43:37.927Z
Answers.Text: Thank you! I will give this a shot. Will 6*1 vector as an input create issues?
Answers.UserDisplayName: Viraj Gajjar
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-03T07:01:45.110Z
Answers.Text: If you use keras , you should resize the input to 6*1*1. The last 1 is the channels. Also, the model should be a bit different, as the 6*1 need to be convolve to 8*2. Perhaps you could increase padding or repeat the 6*1 vector twice to make the input 6*2*1. Then you can make padding to 1 on the first axis and convolve the input. This will make the output 8*2*1.
Answers.UserDisplayName: Clement
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-01T08:18:54.097Z
Answers.LastActivityDate: 2019-06-01T08:32:51.337Z
Answers.LastEditDate: 2019-06-01T08:32:51.337Z
Answers.UserDisplayName: Clement
Body: <p>I am trying to train a deep learning model to predict an 8*2 matrix. The predicted matrix would have complex values and the input matrix would be real numbers. Can it be done? Thank you for your time.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-06-01T02:55:26.283Z
Comments.Text: Do you have access to a large training dataset? (Or can you cheaply create one?)
Comments.UserDisplayName: Hanzy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-06-02T22:39:59.173Z
Comments.Text: I am in the process of creating one. The input would be a 6*1 vector.
Comments.UserDisplayName: Viraj Gajjar
Tags: <deep-learning><convolutional-neural-networks>
Title: How can I train a deep learning model to predict a matrix?
UserDisplayName: Viraj Gajjar
ThreadText: # How can I train a deep learning model to predict a matrix?
  
  (Asked by: username_0 on 2019-06-01)
  
  I am trying to train a deep learning model to predict an 8\*2 matrix. The predicted matrix would have complex values and the input matrix would be real numbers. Can it be done? Thank you for your time.
  
  **Tags:** deep-learning, convolutional-neural-networks
  > **Comments:**
  > **username_1**: Do you have access to a large training dataset? (Or can you cheaply create one?)  
  > **username_0**: I am in the process of creating one. The input would be a 6*1 vector.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-06-01. Score: 1
  
  You could use a CNN or Fully Connected Network and output a matrix of size 8*2*2. The first 8*2 matrix is the real number and the second is the imaginary number. Example code below uses keras.
  '''
  input: numpy array of shape(batch_size,input_dim_0,input_dim_1,1)
  Y: keras tensor of shape(batch_size,8,2,2)
  
  '''
  
  model = Sequential()
  model.add(Conv2d(64,3,input_dim =(input_dim_0,input_dim_1,1))
  model.add(Conv2d(64,3)
  model.add(Conv2d(2,3)
  
  model.compile(loss='MSE',metrixs=['accuracy'])
  model.fit(input,Y)
  
  > **Comments:**
  > **username_0**: Thank you! I will give this a shot. Will 6*1 vector as an input create issues?  
  > **username_2**: If you use keras , you should resize the input to 6*1*1. The last 1 is the channels. Also, the model should be a bit different, as the 6*1 need to be convolve to 8*2. Perhaps you could increase padding or repeat the 6*1 vector twice to make the input 6*2*1. Then you can make padding to 1 on the first axis and convolve the input. This will make the output 8*2*1.  
  
  ---
  
  