Calculate velocity and acceleration in each time step in neural network

1 次查看(过去 30 天)
I am working with feed forward neural network. I have a data set with 46995 rows and 18 columns. First 12 columns are input parameters and other 6 columns are displacement, velocity,acceleration in vertical and torsional directions respectively.
I would like train the network for half time steps and test for the rest. While testing I would like take first input parameters in input2 and update them with output3 for the rest of the time steps.
could anyone help me with this because my results are not matching with target values in the second half.
load 'Dataset'
Dataset(any(isnan(Dataset),2),:)=[];
input1 = Dataset(1:23497,1:12)';
target1 = Dataset(1:23497,[13,15])';
input2 = Dataset(23498:46995,1:12)';
target2 = Dataset(23498:46995,[13,15])';
t1=0:0.0128:300.7808;
t2=300.7808:0.0128:601.5744;
% Create a Fitting Network
hiddenLayerSize = 24;
net = fitnet(hiddenLayerSize);
% Setup Division of Data for Training,
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
% Train the Network
[net,tr] = train(net,input1,target1);
% Test the Network
InputActual = input2(:,1);
output3=zeros(2,23498);
vel=zeros(2,23498);
acc = zeros(2,23498);
for i = 1:23498-1
output3(:,i) = net(InputActual);
vel(:,i) = diff(output3(:,i))./0.0128;
acc(:,i)= diff(vel(:,i))./0.0128;
InputActual =[output3(1,i);vel(1,i);acc(1,i);output3(2,i);vel(2,i);acc(2,i);input2(7:end,i+1)];
end

回答(1 个)

Greg Heath
Greg Heath 2016-10-26
You are implicitly assuming that the summary statistics of the second half are the same as those of the first half.
Why not prove it by comparing the two sets of summary statistics: means, variances and correlation coefficients and designing a two class classifier.
Thank you for formally accepting my answer
Greg

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by