How do I create a "TimeDistributed TensorFlow-Keras" deep network layer in MATLAB?

2 次查看(过去 30 天)
I am trying to create a neural network that performs sequence-to-sequence classification and would like to create the equivalent of a "TimeDistributed TensorFlow-Keras" deep network layer. How can I create such a layer in MATLAB?

采纳的回答

MathWorks Support Team
A "TimeDistributed TensorFlow-Keras" deep network layer can be implemented in MATLAB by wrapping an operation between "sequenceFoldingLayer" and "sequenceUnfoldingLayer" layers from the Deep Learning Toolbox.
1. The "sequenceFoldingLayer" layer brings the batch and time dimensions to a single batch dimension. Please refer to the following documentation page for more information on the layer: 
2. The operation (e.g., a fully connected layer) will be time-distributed since these operations are independent for each batch, and the time dimension is now wrapped in the batch dimension.
3. The "sequenceUnfoldingLayer" layer reintroduces the time dimension by reverting the collapse operation in the sequence folding layer. Please refer to the following documentation page for more information on the layer: 

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Deep Learning Toolbox 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by