我正在尝试为具有形状(7500,81920)的图像创建重建矩阵(A),并且我得到的误差大于2GB。我得到错误的那一行是我计算“our_loss”的那一行。有谁知道我怎么还能在程序中使用这么大的矩阵?
A = np.random.randn(7500, 81920).astype('float32')
y = np.dot(A, v)
y_placeholder = tf.placeholder(tf.float32,[None,m])
our_loss = tf.reduce_mean( tf.reduce_sum( (tf.matmul(tf.reshape(G[0], [1, -1]) , A.T) - y_placeholder)**2, 1))
z_optim = tf.train.AdamOptimizer(learning_rate=0.1).minimize(our_loss, var_list=z)
for i in range(num_iter):
a, closs, b = sess.run([z_optim, our_loss, G],feed_dict={y_placeholder: y})