Skip to content

semipy.sampler.JointSampler

Warning

This section is in construction.

    class semipy.sampler.JointSampler(dataset, batch_size, proportion)

This is a custom sampler made for Semi-Supervised Learning. It allows to sample both labelled and unlabelled items with respect to a ratio between labelled and unlabelled data and by using only one dataset containing both data types. The only condition to respect is to attach a label -1 to unlabelled items. It returns an iterator of batches (lists) of both labelled and unlabelled data's indices, with respect to the specified proportion and batch size.

Parameters

  • dataset - A map-style dataset containing labelled and unlabelled data. Unlabelled data must be attached with a -1 label.
  • batch_size (int) - Size of batches for labelled data.
  • proportion (float) - Proportion of labelled/unlabelled data to use at each batch.