API Reference#
This is the class and function reference of ablator. Please refer to the tutorials for further details, as the class and function raw specifications may not be enough to give full guidelines on their uses.
ablator.analysis: Analysis module#
Plot module#
|
Class for plotting experiment results. |
|
|
|
|
|
|
|
|
Returns a dictionary mapping input attribute names to output attribute names, with optional remapping based on |
Analysis Main classes#
|
A class for analyzing experimental results. |
Analysis Results classes#
|
Class for processing experiment results. |
|
Read the results of an experiment and return them as a pandas DataFrame. |
ablator.config: Config module#
Base Config classes#
|
This class this the building block for all configuration objects within ablator. |
Decorator for ConfigBase subclasses, adds the |
Prototype Config classes#
|
A base class for model configuration. |
|
The base configuration that defines the setting of an experiment (experiment main directory, number of checkpoints to maintain, hardware device to use, etc.). |
|
Training configuration that defines the training setting, e.g., batch size, number of epochs, the optimizer to use, etc. |
Config Type classes#
This type is for attributes that are derived during the experiment (after launching the experiment). |
HPO Config classes#
|
Type of search space. |
|
Search space configuration, required in parallel experiments, is used to define the search space for a hyperparameter. |
Parallel Config classes#
|
Type of optimization direction. |
|
Parallel training configuration, extending from |
|
Type of search algorithm. |
Config Utils functions#
|
Calculates the MD5 hash of one or more dictionaries. |
|
Flattens a nested dictionary, expanding lists and tuples if specified. |
ablator.main: Main module#
HPO Sampler module#
|
|
|
OptunaSampler this class serves as an interface for Optuna based samplers. |
Main Model module#
|
Base class that removes training boiler-plate code with extensible support for multiple use-cases. |
|
A wrapper around |
Experiment State module#
|
|
|
An enumeration of possible states for a trial with more pruned states. |
Prototype Trainer classes#
|
Manages resources for Prototyping. |
Multi-process Trainer classes#
|
A class for parallelizing training and hyperparameter optimization of models of different configurations with ray. |
|
The trial job that will be executed remotely at a ray node. |
ablator.modules: Extra modules#
Metrics module#
|
Stores and manages predictions and calculates metrics given some custom evaluation functions. |
Base class for manipulations (storing, getting, resetting) of batches of values. |
|
This class is used to store moving average metrics |
|
A class for storing prediction scores. |
Storage module#
|
Configuration for a remote storage. |
|
Run a command and wait for it to finish. |
Optimizer classes#
|
A base class for optimizer arguments, here we define learning rate lr. |
|
Configuration for an optimizer, including optimizer name and arguments (these arguments are specific to a certain type of optimizer like SGD, Adam, AdamW). |
|
Configuration for an SGD optimizer. |
|
Configuration for an AdamW optimizer. |
|
Configuration for an |
|
Recurse into the module and return parameter names of all submodules, excluding modules that are of any type defined in |
Setup the optimizer. |
Scheduler classes#
|
Abstract base class for defining arguments to initialize a learning rate scheduler. |
|
A class that defines a configuration for a learning rate scheduler. |
|
Configuration class for StepLR scheduler. |
|
Configuration class for the OneCycleLR scheduler. |
|
Configuration class for ReduceLROnPlateau scheduler. |
ablator.utils: Utilities#
Base utilities#
|
Applies a given function |
Check if the debugger is currently active. |
|
|
Get the memory information of all available GPUs. |
|
Get a list of all checkpoint files in a directory, sorted from the latest to the earliest. |
|
Get the learning rate from an optimizer. |
|
Initialize the weights of a module. |
is_oom_exception checks whether the exception is caused by CUDA out of memory errors. |
|
|
Moving torch.Tensor elements to the specified device. |
|
Convert elements of the input iterable to NumPy arrays if they are torch.Tensor objects. |
|
Format number to be no larger than width by converting to scientific notation when the value exceeds width either by informative decimal places or size. |
|
Parse a device string, an integer, or a list of device strings or integers. |
|
Set the random seed. |
File utilities#
Remove all but the n latest checkpoints from the given directory. |
|
Converts the input value to a JSON compatible format. |
|
|
Convert a dictionary into a JSON string. |
|
Convert a JSON string into a dictionary. |
|
Create subdirectories under the given parent directory. |
|
Set a value in a nested dictionary. |
|
Save a checkpoint of the given state. |