by: Chris Cave & Jaan Kasak
(Feyn version 2.0 or newer)
feyn.prune_models removes redundant and poor performing
Models from a list. It expects the list to be sorted by some metric. The best three unique
Models in the list are never removed, regardless of dropout and decay.
This is typically used after fitting and prior to updating. This ensures we keep
Models with high potential, conserve computational resources, as well breaking out of local minima.
import feyn from feyn.datasets import make_classification train, test = make_classification() ql = feyn.connect_qlattice() models = ql.sample_models(train.columns, 'y', 'classification', max_complexity=10) models = feyn.fit_models(models, train, 'binary_cross_entropy', 'bic', 4) models = feyn.prune_models( models=models, dropout=True, decay=True )
This is the list of
Models you want to remove the redundant and poor performing ones from.
dropout=True, it will at random remove
Models based on where in the
QLattice they were generated. This acts as a regularizer and allows more diverse models to compete.
Models get removed based on a decay function. A
Model decays as a function of how many epochs it has been fitted and its performance compared to its peers.
This prevents us fitting
Models that are not going to improve any further.