Maggy Developer API

As a developer you have the possibility to implement your custom optimizers or ablators. For that you can implement an abstract method, which you can then pass as an argument when launching the experiment. For examples, please look at existing optimizers and ablators.

maggy.optimizer module

maggy.ablation.ablator module

class maggy.ablation.ablator.abstractablator.AbstractAblator(ablation_study, final_store)

This method will be called before finishing the experiment. Developers can implement this method e.g. for cleanup or extra logging.

get_dataset_generator(ablated_feature, dataset_type='tfrecord')

Create and return a dataset generator function based on the ablation policy to be used in a trial. The returned function will be executed on the executor per each trial.

  • ablated_feature (str) – the name of the feature to be excluded from the training dataset. Must match a feature name in the corresponding feature group in the feature store.
  • dataset_type – type of the dataset. For now, we only support ‘tfrecord’.

A function that generates a TFRecordDataset

Return type:



If applicable, calculate and return the total number of trials of the ablation experiment. Make sure to also include the base (reference) trial in the count.

Returns:total number of trials of the ablation study experiment
Return type:int

Return a Trial to be assigned to an executor, or None if there are no trials remaining in the experiment. The trial should contain a dataset generator and a model generator. Depending on the ablator policy, the trials could come from a list (buffer) of pre-made trials, or generated on the fly.

Return type:Trial or None

Initialize the ablation study experiment by generating a number of trials. Depending on the ablation policy, this method might generate all the trials (e.g. as in LOCO), or generate a number of trials to warm-start the experiment. The trials should be added to trial_buffer in form of Trial objects.