Deep Network Designer - LSTM Training Data Post Processing and Creating a Datastore

2 views (last 30 days)
Hi,
I have been using the shipping example LSTM ROM as the base for my code to create a ROM using an LSTM.
Now that I have the code and network running OK, I would now like to use the Deep Network Designer app and the Experiment Manager to speed up optimisation of the network by running though some different hyperparameters rather than manually changing and re-running the code.
Using the code in the example the training data (dataTrain: with 9 observations and 5 signals) and test data (dataTest: 1 observation with 5 signals) are now contained in a 1x9 cell and 1x1 cell respectively. I have created a signal data store for both cells to allow the data to be imported into the DND app. However, I am encountering an error when I try to train the network. Is the data now pre-processed using the example code the correct format for using the app?
Code modified from LSTM ROM shipping example to partition and format the 10 imported data sets into 9 training data sets and 1 test data set.
% 10 ANSYS Simulations Conducted
numObservations = 10;
% CR Sweeps
CR_Sweep = [21.0,20.5,19.5,19.0,18.0...
17.5,17.0,16.5,16.0,15.5];
% Concatenate all 10 data sets to a single cell array
data = {data_01; data_02; data_03; data_04; data_05; data_06; data_07; data_08; data_09; data_10};
%Prepare Data for Training
%Specify a sample time for Training
downsamplefactor = 1;
sampleTime = timeInterval*downsamplefactor; % Sample rate for LSTM Training [s]
%Downsample the training data by extracting time steps with a fixed interval given by the sample time divided by the time interval of the simulation.
intervalDownsampled = sampleTime / timeInterval;
timeStepsDownsampled = 1:intervalDownsampled:numTimeSteps;
for i = 1:numObservations
dataDownsampled{i} = data{i}(:,timeStepsDownsampled);
end
%Partition the training data into training and test partitions using the trainingPartitions function.
[idxTrain,idxTest] = trainingPartitions(numObservations,[0.9 0.1]);
CRSweepTrain = CR_Sweep(idxTrain);
CRSweepTest = CR_Sweep(idxTest);
dataTrain = dataDownsampled(idxTrain);
dataTest = dataDownsampled(idxTest);
%Create signal datastore for import into Deep Network Designer
dsd_Train = signalDatastore(dataTrain);
dsd_Test = signalDatastore(dataTest);

Answers (0)

Categories

Find more on Deep Learning with Time Series and Sequence Data in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!