Which are the training examples in a sequence classification?
1 次查看(过去 30 天)
显示 更早的评论
I am implementing a Sequence-to-Sequence Classification. As an example here it is the documentation from mathworks:
Exploring the various fields of the function trainingOptions i have a doubt about the definition of the 'MiniBatchSize' and the training sample definition. If i have 8 sequences of 2000 time samples each which are considered training samples for the mini-batch?
- the 8 sequences, so if i define a minibatch of 1 i will feed the networks with 2000 samples each training iteration.
- the 2000x8 samples, so if i define a minibatch of 100 i will feed the networks with 100 time samples at each iteration.
0 个评论
采纳的回答
Raunak Gupta
2020-2-21
Hi,
The 'MiniBatchSize' creates batches in the observation dimension, not the time dimension. For example, having 8 sequences with 2000 length each if you want to have 2 batches for training in each epoch the MiniBatchSize will be 4.
If you want to create batches across time dimension you can use ‘SequenceLength’ parameter. The default 'SequenceLength' parameter is ‘longest’, which means that the batch sequence length is determined by the longest sequence in the batch. So, if you want to create a minibatch of 100 samples setting the ‘SequenceLength’ to 100 will create 20 small sequence for each sequence and based on MinBatchSize the overall iterations will be calculated.
So, to correctly state if you define 'SequenceLength' of 100 and ‘MiniBatchSize’ of 1, then the trainNetwork will feed the network with 100 time samples at each iteration.
Hope this clarifies.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!