aixplain.modules.finetune.hyperparameters
SchedulerType Objects
class SchedulerType(Text, Enum)
Enum representing different learning rate schedulers.
This enum defines the possible learning rate schedulers that can be used in the fine-tuning process. Each scheduler is represented by a string constant.
Attributes:
LINEARText - Linear learning rate scheduler.COSINEText - Cosine learning rate scheduler.COSINE_WITH_RESTARTSText - Cosine with restarts learning rate scheduler.POLYNOMIALText - Polynomial learning rate scheduler.CONSTANTText - Constant learning rate scheduler.CONSTANT_WITH_WARMUPText - Constant with warmup learning rate scheduler.INVERSE_SQRTText - Inverse square root learning rate scheduler.REDUCE_ON_PLATEAUText - Reduce learning rate on plateau learning rate scheduler.
Hyperparameters Objects
@dataclass_json
@dataclass
class Hyperparameters(object)
Configuration for the fine-tuning process.
This class encapsulates the hyperparameters for training a model using a fine-tuning approach. It includes settings for epochs, batch sizes, learning rates, sequence lengths, and learning rate schedulers.
Attributes:
epochsint - Number of training epochs.train_batch_sizeint - Batch size for training.eval_batch_sizeint - Batch size for evaluation.learning_ratefloat - Learning rate for training.max_seq_lengthint - Maximum sequence length for model inputs.warmup_ratiofloat - Warmup ratio for learning rate scheduler.warmup_stepsint - Number of warmup steps for learning rate scheduler.lr_scheduler_typeSchedulerType - Type of learning rate scheduler.
__post_init__
def __post_init__()
Post-initialization validation for the hyperparameters.
This method performs validation checks on the hyperparameters after initialization. It ensures that the provided values are of the correct types and within the allowed ranges.
Raises:
TypeError- If the provided values are not of the correct types.ValueError- If the provided values are outside the allowed ranges.