Multiple input (sequence and static) to a dag network

조회 수: 2 (최근 30일)
Mona Ramadan
Mona Ramadan 2020년 3월 2일
편집: Yildirim Kocoglu 2020년 11월 27일
I want to train a DAG_net with two inputs, the dag network is shown below:
My two inputs are : a sequential timeseries data with 17 features for 60 training examples. The other input is a static feature for the 60 training samples. Here is a screenshot of my training data
  댓글 수: 1
Yildirim Kocoglu
Yildirim Kocoglu 2020년 11월 27일
편집: Yildirim Kocoglu 2020년 11월 27일
Mona, have you by any chance solved this issue?
I'm trying to do the same exact thing with similar data as yours except my output is also a sequence.
I got the add/concatonate layer idea from a post I read online and a paper which shows the architecture as shown below:
My architecture looks similar to yours as below:
My training code looks something like this (to show it needs 2 inputs to train):
net = trainNetwork({XTrain(1:510,:);Static_features(1:510,:)'},YTrain(1:510,:),lgraph,options);
I use the same lgraph object as plotted above and XTrain (for temporal inputs) and Static_features (for static inputs) and a single output "YTrain" that should be a sequence similar to XTrain with multiple cells (similar to your XTrain). This is a prediction network that predicts the next time step value (YTrain) from the previous time step (XTrain).
However, when I try to train the network I get this error (next line of error says: if sequenceInputLayer is present, it can't accept any other type of input layer):
Network: Incompatible layer types. The network contains layer types not supported with recurrent layers.
Detected recurrent layers:
layer 'bilstm1' (BiLSTM)
layer 'bilstm2' (BiLSTM)
layer 'bilstm3' (BiLSTM)
layer 'bilstm4' (BiLSTM)
and 1 other layers.
For static_input I use an imageInputLayer but, I tried every layer that exists in Matlab 2020a (apparently featureInputLayer is not avaiable in 2020a) and it still gives me the same error.
I searched for every post I believe and can't seem to find a tutorial nor an example showing how to achieve this (if it is possible). The closest thing I found was using CNN-RNN but, that is with images (frames of a video) and has a single input layer.

댓글을 달려면 로그인하십시오.

답변 (1개)

Divya Gaddipati
Divya Gaddipati 2020년 4월 15일
Hi,
The latest version of MATLAB allows the training of networks with multiple inputs. Please refer to the following link for more information:
You can also use combineDatastore for this purpose.
Alternatively, you can also create a custom layer that accepts multiple inputs.
Hope this helps!

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by