What is the difference between formatted and unformatted dlarrays?

6 ビュー (過去 30 日間)
Mirko Job
Mirko Job 2020 年 3 月 25 日
編集済み: Sai Bhargav Avula 2020 年 3 月 25 日
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

採用された回答

Sai Bhargav Avula
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 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by