How should I structure the neural net based on my given input and output training data

2 ビュー (過去 30 日間)
Devin Hunter
Devin Hunter 2022 年 8 月 7 日
コメント済み: Devin Hunter 2022 年 8 月 8 日
I am trying to design a feedforward network that trains on a 4x5 matrix (5 samples of 4 separate inputs into the neural network) and its outputs are represented by a 4x5x1000 matrix (5 samples of 4 outputs where each component of the 4x1 output vector has 1000 points). This neural net is used to determine an optimal trajectory for a given terminal condition from a set of the same initial conditions . The code for this project will be placed below:
%% Neural Net Training Process
% Initial State
x1 = [0;0]; % Initial Positions
x2 = [1;1]; % Initial Velocities
xo = [x1;x2]; % 4x1 Initial State Vector
% Parsing Training Input Data
x_input = [xf1,xf2,xf4,xf5,xf6]; % 4x5 Terminal State Vector (each xf (4x1) represents a different terminal condition)
% Parsing Training Output Data
x_output = [];
for i=1:4
x_output(i,1,:) = x1(:,i);
x_output(i,2,:) = x2(:,i);
x_output(i,3,:) = x4(:,i);
x_output(i,4,:) = x5(:,i);
x_output(i,5,:) = x6(:,i);
end % 4x5x1000 Terminal State Matrix
% Parsing Validation Data
xf_valid = xf3;
x_valid = x3';
% Neural Net Architecture Initialization
netconfig = 40;
net = feedforwardnet(netconfig);
net.numInputs = 4;
% Training the Network
for j=1:5
curr_xin = x_input(:,j);
curr_xout = x_output(:,j,:);
net = train(net,curr_xin,curr_xout);
end
From here, I am receieve an error in line 89, where I get the following error: Error using nntraining.setup>setupPerWorker (line 96)
Targets T is not two-dimensional. Any advice from here would be appreciated. Thanks.
  1 件のコメント
Devin Hunter
Devin Hunter 2022 年 8 月 8 日
Also, if you need more details on how the data is exactly being collected, this previous thread showed how exactly the data itself was collected. (Ignore the way that I structured the training data in that previous example as I figured out that it was wrong)

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by