DARTS Profile

class confopt.profile.DARTSProfile(trainer_preset: str | TrainerPresetType, epochs: int, use_lambda_regularizer: bool = False, **kwargs: Any)

Bases: BaseProfile, ABC

Train Profile class for DARTS (Differentiable Architecture Search). It inherits from the BaseProfile class and sets the sampler config for DARTS sampler.

__init__()

Initializes the DARTSProfile object.

_initialize_sampler_config()

Initializes the sampler configuration for DARTS.

configure_lambda_regularizer(**kwargs: Any) None
configure_sampler(**kwargs) None

Configures the sampler settings based on provided keyword arguments.

The configuration options are passed as keyword arguments.

Parameters:

**kwargs – Arbitrary keyword arguments. Possible keys include: sample_frequency (str): The rate at which samples should be taken arch_combine_fn (str): The function used to combine architectures when FairDARTS is used, this should be ‘sigmoid’. Default value is ‘default’.

Example

>>> from confopt.profile import DARTSProfile
>>> darts_profile = DARTSProfile(trainer_preset='darts', epochs=50)
>>> darts_profile.configure_sampler(arch_combine_fn='sigmoid')

The accepted keyword arguments should align with the sampler’s configuration and the attributes can be configured dynamically.

Raises:

ValueError – If an unrecognized keyword is passed in kwargs.

Returns:

None

get_config() dict

This method returns a dictionary representation of the Profile class. The configurations are used for training the supernet.

Parameters:

None

Returns:

dict – A dictionary representation of the Profile class.