yamle.methods.ensemble module#
- class yamle.methods.ensemble.EnsembleMethod(*args, **kwargs)[source]#
Bases:
MemberMethodThis is a Method class for the Ensemble model.
It uses the Ensemble model to wrap around the original model and then uses the base method to train the members one by one in cooperation with the EnsembleTrainer class.
- Parameters:
num_members¶ (int) – The number of members in the ensemble.
- class yamle.methods.ensemble.SnapsotEnsembleMethod(*args, **kwargs)[source]#
Bases:
EnsembleMethodThis is a Method class for the Snapshot Ensemble method.
It uses the Ensemble model to wrap around the original model and then uses the base method to train the network via the cyclic learning rate scheduler. Each time the learning rate hits the minimum, the current model is saved as the next member, while the learning rate is reset to the maximum value and the main model is trained further.
- Parameters:
num_members¶ (int) – The number of members in the ensemble.
- get_parameters(recurse=True)[source]#
A helper function to get the parameters of a single ensemble member.
In this case, get always the first one.
- Return type:
List[Parameter]
- class yamle.methods.ensemble.GradientBoostingEnsembleMethod(num_members, shrinkage=1.0, *args, **kwargs)[source]#
Bases:
EnsembleMethodThis is a Method class for the Gradient Boosting Ensemble method.
It uses the Ensemble model to wrap around the original model and then uses the base method to train the network.
- Parameters: