AI::MXNet::Gluon::Data::Sampler
Base class for samplers. All samplers should subclass AI::MXNet::Gluon::Data::Sampler and define method 'len' and 'next' methods.
AI::MXNet::Gluon::Data::Sampler::SequentialSampler
Samples elements from [0, length) sequentially. Parameters ---------- length : int Length of the sequence.
AI::MXNet::Gluon::Data::Sampler::RandomSampler
Samples elements from [0, length) randomly without replacement. Parameters ---------- length : int Length of the sequence.
AI::MXNet::Gluon::Data::Sampler::BatchSampler
Wraps over another AI::MXNet::Gluon::Data::Sampler and return mini-batches of samples. Parameters ---------- sampler : AI::MXNet::Gluon::Data::Sampler The source Sampler. batch_size : int Size of mini-batch. last_batch : {'keep', 'discard', 'rollover'} Specifies how the last batch is handled if batch_size does not evenly divide sequence length. If 'keep', the last batch will be returned directly, but will contain less element than `batch_size` requires. If 'discard', the last batch will be discarded. If 'rollover', the remaining elements will be rolled over to the next iteration. Examples -------- >>> $sampler = gluon->data->SequentialSampler(10) >>> $batch_sampler = gluon->data->BatchSampler($sampler, batch_size => 3, last_batch => 'keep'); >>> @{ $batch_sampler } [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]
To install AI::MXNet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AI::MXNet
CPAN shell
perl -MCPAN -e shell install AI::MXNet
For more information on module installation, please visit the detailed CPAN module installation guide.