Shortcuts

Semi-supervised learning

Collection of utilities for semi-supervised learning where some part of the data is labeled and the other part is not.

Note

We rely on the community to keep these updated and working. If something doesn’t work, we’d really appreciate a contribution to fix!


Balanced classes

Example:

from pl_bolts.utils.semi_supervised import balance_classes
pl_bolts.utils.semi_supervised.balance_classes(X, y, batch_size)[source]

Warning

The feature balance_classes is currently marked under review. The compatibility with other Lightning projects is not guaranteed and API may change at any time. The API and functionality may change without warning in future releases. More details: https://lightning-bolts.readthedocs.io/en/latest/stability.html

Makes sure each batch has an equal amount of data from each class. Perfect balance.

Parameters
Return type

Tuple[ndarray, ndarray]

half labeled batches

Example:

from pl_bolts.utils.semi_supervised import balance_classes
pl_bolts.utils.semi_supervised.generate_half_labeled_batches(smaller_set_x, smaller_set_y, larger_set_x, larger_set_y, batch_size)[source]

Warning

The feature generate_half_labeled_batches is currently marked under review. The compatibility with other Lightning projects is not guaranteed and API may change at any time. The API and functionality may change without warning in future releases. More details: https://lightning-bolts.readthedocs.io/en/latest/stability.html

Given a labeled dataset and an unlabeled dataset, this function generates a joint pair where half the batches are labeled and the other half is not.

Return type

Tuple[ndarray, ndarray]

Read the Docs v: stable
Versions
latest
stable
0.7.0
0.6.0.post1
0.6.0
0.5.0
0.4.0
0.3.4
0.3.3
0.3.2
0.3.1
0.3.0
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.1
docs-build-rtd
0.1.0
Downloads
pdf
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.