Matrix multiplication of a dlarray object in a custom loss function
6 次查看(过去 30 天)
显示 更早的评论
Hi,
I have written a deep learning training loop with a custom loss function. Within this loss function, the output of my basic feedforward network is a dlarray matrix ~50(C) x 2000(B). The 50 channels in this matrix are a condensed representation of my desired output, which is a larger ~1500(C) x 2000(B) matrix. The matrix product of the output of my feedforward network with another (known) matrix gets me to this desired matrix, and from this I would like to calculate the mse loss. Essentially I need to reverse the eigendecomposition and calculate loss for that larger matrix, followed by a call to dlgradient to train my network. From reading documentation it seems that mtimes is not fully supported with dlarray objects. Am I missing an obvious alternative way to do what I want? I can manually do the matrix multiplication using scalar multiplication within loops but this is hopelessly slow. I would have expected this to not be an unusual step within custom training loops... can anyone suggest a way to accomplish this?
Many thanks!
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!