graph LR
AlgorithmBase["AlgorithmBase"]
SSLAlgorithmImplementations["SSLAlgorithmImplementations"]
LossFunctions["LossFunctions"]
AlgorithmHooks["AlgorithmHooks"]
NetworkArchitectures["NetworkArchitectures"]
Data_Management_Module["Data Management Module"]
Algorithm_Specific_Utilities["Algorithm-Specific Utilities"]
SSLAlgorithmImplementations -- "inherits from" --> AlgorithmBase
AlgorithmBase -- "orchestrates use of" --> LossFunctions
AlgorithmBase -- "orchestrates use of" --> AlgorithmHooks
SSLAlgorithmImplementations -- "instantiates/uses" --> NetworkArchitectures
AlgorithmBase -- "interacts with" --> Data_Management_Module
SSLAlgorithmImplementations -- "utilizes" --> Algorithm_Specific_Utilities
The semilearn project is structured around a core AlgorithmBase that defines the fundamental training loop and interaction points for various semi-supervised learning algorithms. Concrete SSLAlgorithmImplementations extend this base, each integrating specific LossFunctions, leveraging AlgorithmHooks for flexible behavior modification, and utilizing diverse NetworkArchitectures for model backbones. Data is managed by the Data Management Module, which prepares input for the algorithms. Algorithm-Specific Utilities provide specialized support for individual algorithm requirements. This modular design promotes extensibility and maintainability, allowing for easy integration of new algorithms and network architectures.
Serves as the abstract foundation for all semi-supervised learning algorithms. It provides a standardized training loop, handles model and optimizer setup, manages data flow, and integrates a robust hook management system. This class defines the core contract and common functionalities for all specific SSL algorithms.
Related Classes/Methods:
This component represents the collection of concrete semi-supervised learning algorithms (e.g., FixMatch, Mean Teacher, CoMatch, FlexMatch, FreeMatch, ReMixMatch, SoftMatch, VAT, CRMatch). Each algorithm extends AlgorithmBase and implements its unique training logic, loss functions, and regularization methods to effectively leverage unlabeled data.
Related Classes/Methods:
semilearn.algorithms.fixmatch.fixmatch.FixMatch:11-114semilearn.algorithms.meanteacher.meanteacher.MeanTeacher:11-83semilearn.algorithms.comatch.comatch.CoMatch:72-275semilearn.algorithms.crmatch.crmatch.CRMatch:119-292semilearn.algorithms.flexmatch.flexmatch.FlexMatch:15-140semilearn.algorithms.freematch.freematch.FreeMatch:47-153semilearn.algorithms.remixmatch.remixmatch.ReMixMatch:49-228semilearn.algorithms.softmatch.softmatch.SoftMatch:13-146semilearn.algorithms.vat.vat.VAT:14-145
A dedicated module responsible for implementing and providing various loss calculations, including common and algorithm-specific loss functions. These functions are crucial for guiding the optimization process during the training of all semi-supervised learning algorithms.
Related Classes/Methods:
semilearn.core.criterions.consistency.ConsistencyLoss:44-49semilearn.core.criterions.cross_entropy.CELoss:34-39
Provides a flexible mechanism for extending and modifying the behavior of algorithms at various stages of the training process. This includes general-purpose hooks and specialized hooks (e.g., for thresholding or weighting) that allow for custom logic insertion without altering the core algorithm implementations.
Related Classes/Methods:
semilearn.core.hooks.hook.Hook:6-42semilearn.algorithms.flexmatch.flexmatch_hook.FlexMatchHook:1-100semilearn.algorithms.softmatch.softmatch_hook.SoftMatchHook:1-100
Encompasses various neural network models and backbone architectures that can be instantiated and utilized by the semi-supervised learning algorithms. This includes general-purpose backbones and specific network designs tailored for particular algorithms (e.g., CoMatch_Net, CRMatch_Net). This component also serves as the "Model Zoo" providing pre-trained or configurable models.
Related Classes/Methods:
semilearn.nets:1-100semilearn.nets.resnet.ResNet:1-100semilearn.nets.vit.VisionTransformer:1-100semilearn.algorithms.comatch.comatch_net.CoMatch_Net:1-100semilearn.algorithms.crmatch.crmatch_net.CRMatch_Net:1-100
Handles the entire lifecycle of data, including dataset loading, preprocessing, augmentation, and the creation of data loaders. It provides the necessary input streams (labeled and unlabeled data) that feed into the semi-supervised learning algorithms for training and evaluation.
Related Classes/Methods:
Contains specialized helper functions and modules that provide unique functionalities required by particular semi-supervised learning algorithms. These utilities ensure that the distinct operational requirements and complex calculations of individual algorithms are met.
Related Classes/Methods: