What is the difference between formatted and unformatted dlarrays?
6 次查看(过去 30 天)
显示 更早的评论
I am trying to implement a custom deeplearning training loop and i noticed that starting from:
dlY1; % Unformatted dlarray 175x1x53696
dlY2=dlarray(dlY1,'CBT') % Formatted version of dlY1
The functions:
res1=lstm(dlY1,H0,C0,Weights,RecurrentWeights,parameters.LSTM.Bias,'DataFormat','CBT');
res2=lstm(dlY2,H0,C0,Weights,RecurrentWeights,parameters.LSTM.Bias);
Give two different results:
res1; %53696x3 dlarray
res2; %3x1x53696 dlarray
Can someone explain this? I was expecting the same values as results
0 个评论
采纳的回答
Sai Bhargav Avula
2020-3-25
编辑:Sai Bhargav Avula
2020-3-25
Hi, By having formatted dlarray enforces the order of labels 'SCBTU'. This enforcement eliminates ambiguous semantics in operations, which implicitly match labels between inputs. dlarray also enforces that the labels 'C', 'B', and 'T' can each appear at most once. The functions that use these labels accept at most one dimension for each label.
Here in your case the value of the results are same, but their format is different as formatted dlarray enforce the format constraints, where as unformatted dlarray does not enforce any constraints
Hope this helps!
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!