How should I structure the neural net based on my given input and output training data
I am trying to design a feedforward network that trains on a 4×5 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 4×1 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]; % 4×1 Initial State Vector
% Parsing Training Input Data
x_input = [xf1,xf2,xf4,xf5,xf6]; % 4×5 Terminal State Vector (each xf (4×1) 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.I am trying to design a feedforward network that trains on a 4×5 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 4×1 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]; % 4×1 Initial State Vector
% Parsing Training Input Data
x_input = [xf1,xf2,xf4,xf5,xf6]; % 4×5 Terminal State Vector (each xf (4×1) 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. I am trying to design a feedforward network that trains on a 4×5 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 4×1 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]; % 4×1 Initial State Vector
% Parsing Training Input Data
x_input = [xf1,xf2,xf4,xf5,xf6]; % 4×5 Terminal State Vector (each xf (4×1) 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. neural network, feedforwardnet, control, matlab MATLAB Answers — New Questions