Data input and target formatting for Deep Learning Models
1 Comment
Answers (7)
Hi Isabelle,
After going through permute.m file, I wanted to find out what is this error your code, Error using dlarray/permute (line 54) is referring to,
53 if ~isequal(dims(obj), origDims) 54 error(message('deep:permute:ChangeDims')); 55 end
So, this error message 'deep:permute:ChangeDims' typically occurs when there is an issue with the dimensions specified in the permute function in MATLAB. To illustrate this fix and provide an example with printed results, let's consider a sample scenario with random data:
>> % Sample Data XTrain = rand(4, 3, 2); % Creating a random 3D array disp('Original XTrain:'); disp(XTrain);
% Permute Dimensions Features = permute(XTrain, [1 3 2]); disp('Permuted Features:'); disp(Features);
When you run this code snippet, you should see the original XTrain array followed by the permuted Features array in the MATLAB command window. Please see attached results.
This demonstrates how the permute function can be used correctly to rearrange the dimensions of a 3D array without encountering the 'deep:permute:ChangeDims' error. By following these steps and ensuring that the dimensions are correctly specified in the permute function, you can avoid the error message and successfully manipulate the dimensions of your data arrays in MATLAB.
0 Comments
0 Comments
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!