how to sort dlarrays
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
feynman feynman
am 4 Dez. 2022
Kommentiert: Xiaoke
am 13 Sep. 2024
How to sort dlarrays like in
sort(a)
, where a is a numeric array? Is there a way of sorting next(mbq) by specifying some options in the following code?
mbq = minibatchqueue(ads,MiniBatchSize=miniBatchSize,MiniBatchFormat="BC");
next(mbq)
Akzeptierte Antwort
Aritra
am 20 Mär. 2023
A "dlarray" is a deep learning array designed to store data with optional data format labels for custom training loops. It also enables functions to compute and use derivatives through automatic differentiation.
However, to sort a "dlarray" you must initially convert it to a double array using the "extractdata" function. You can then use the "sort" function to sort the double array. The following code describes the same:
X = randn(1,5);
dlX = dlarray(X);
t = extractdata(dlX);
sort(t);
For detail, please see this MathWorks documentation below for more information on sorting multi-dimensional arrays: https://in.mathworks.com/help/matlab/ref/double.sortrows.html#d124e1400369
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Custom Training Loops finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!