how to construct a batch for multiple trajectories in neural network
古いコメントを表示
If we have more than one trajectory and want to construct a batch for all these trajectories what will be the possible way to use all the trajectroies for the batch in neural network?
e.g this will work for multiple trajectories?
function [x0, targets] = createMiniBatch(numTimesteps,numTimesPerObs,miniBatchSize,X)
% e.g: numTimesteps=20;numTimesPerObs=5; miniBatchSize=10;
% Create batches of trajectories.
s = randperm(numTimesteps - numTimesPerObs, miniBatchSize);
x0 = dlarray(X(:, s));
targets = zeros([size(X,1) miniBatchSize numTimesPerObs]);
for i = 1:miniBatchSize
targets(:, i, 1:numTimesPerObs) = X(:, s(i) + 1:(s(i) + numTimesPerObs));
end
end
or there is another way for batch for multiple trajectroies
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Preprocess Data for Deep Neural Networks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!