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!