Data input and target formatting for Deep Learning Models
댓글 수: 1
답변 (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
댓글 수: 0
참고 항목
카테고리
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!