<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>

CC BY-SA 4.0
2019-06-02T22:43:37.927Z
Thank you! I will give this a shot. Will 6*1 vector as an input create issues?
Viraj Gajjar
CC BY-SA 4.0
2019-06-03T07:01:45.110Z
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.
Clement
CC BY-SA 4.0
2019-06-01T08:18:54.097Z
2019-06-01T08:32:51.337Z
2019-06-01T08:32:51.337Z
Clement
<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>

CC BY-SA 4.0
2019-06-01T02:55:26.283Z
Do you have access to a large training dataset? (Or can you cheaply create one?)
Hanzy
CC BY-SA 4.0
2019-06-02T22:39:59.173Z
I am in the process of creating one. The input would be a 6*1 vector.
Viraj Gajjar
<deep-learning><convolutional-neural-networks>
How can I train a deep learning model to predict a matrix?
Viraj Gajjar
# 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.  

---

