How can I interpolate a multiinput-multioutput function in MATLAB based on scattered data?

조회 수: 3 (최근 30일)
Given is a matrix 'A' with size 'm' x 'n' which contains a set of scattered data. Integer 'n' can be split into 'n1' and 'n2', where 'n1' stands for the number of input variables and 'n2' stands for the output variables of a function f, such that '[y1, y2, ..., yn2] = f(x1, x2, ..., xn1)'. Then, integer 'm' stands for the number of provided pairs of tuples '(y1, y2, ..., yn2)' - '(x1, x2, ..., xn1)'. It is sought for a workflow that allows the intepolated output tuple '(yHat1, yHat2, ..., yHatn2)' of function 'f' on a new input tuple '(xHat1, xHat2, ...,xHatn1)'.
How can I interpolate a multiinput-multioutput function in MATLAB?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2020년 12월 16일
As of R2020b, there is no available method in MATLAB that allows the interpolation a multiinput-multioutput function based on scattered data. 'scatteredInterpolant' can only be used for up to 3 dimensions.
This workflow can be achieved by training a deep neural network on the provided pairs of tuples exploiting the 'featureInputLayer' for the input layer of the corresponding network. An example is provided in the following, that should serve as a demonstration and should be adjusted for a particular training task:
 
%% Number of input and output variables
numInput = n1;
numOutput = n2;
%% Definition of the training data
x = A(:, 1:numInput);
y = A(:, numInput + 1:end);
%% Definition of a sample layer architecture
layers = [ ...
  featureInputLayer(numInput, "Name", "myFeatureInputLayer")
  fullyConnectedLayer(8, "Name", "myFullyConnectedLayer1")
  tanhLayer("Name", "myTanhLayer")
  fullyConnectedLayer(numOutput, "Name", "myFullyConnectedLayer2")
  regressionLayer("Name", "myRegressionLayer")
];
%% Definition of sample training options
opts = trainingOptions('adam', ...
  'MaxEpochs', 1000, ...
  'InitialLearnRate', 0.01,...
  'Shuffle', 'every-epoch', ...
  'Plots', 'training-progress', ...
  'MiniBatchSize', 128, ...
  'Verbose', false);
%% Training of the network
[trainedNet, info] = trainNetwork(x, y, layers, opts);
%% Compute a predicted output tuple on a new input tuple
% Please replace 'xHat' with the input vector of the actual application case
% in order to be able to run the following commands
% xHat = [xHat1 xHat2 ... xHatn1];
% yHat = predict(trainedNet, xHat)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Deep Learning Toolbox에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by