LoraTrainingConfig¶
- class oci.generative_ai.models.LoraTrainingConfig(**kwargs)¶
Bases:
TrainingConfigThe Lora training method hyperparameters.
Attributes:
A constant which can be used with the training_config_type property of a TrainingConfig.
A constant which can be used with the training_config_type property of a TrainingConfig.
A constant which can be used with the training_config_type property of a TrainingConfig.
Gets the early_stopping_patience of this TrainingConfig.
Gets the early_stopping_threshold of this TrainingConfig.
Gets the learning_rate of this TrainingConfig.
Gets the log_model_metrics_interval_in_steps of this TrainingConfig.
Gets the lora_alpha of this LoraTrainingConfig.
Gets the lora_dropout of this LoraTrainingConfig.
Gets the lora_r of this LoraTrainingConfig.
Gets the total_training_epochs of this TrainingConfig.
Gets the training_batch_size of this TrainingConfig.
[Required] Gets the training_config_type of this TrainingConfig.
Methods:
__init__(**kwargs)Initializes a new LoraTrainingConfig object with values from keyword arguments.
get_subtype(object_dictionary)Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
- TRAINING_CONFIG_TYPE_LORA_TRAINING_CONFIG = 'LORA_TRAINING_CONFIG'¶
A constant which can be used with the training_config_type property of a TrainingConfig. This constant has a value of “LORA_TRAINING_CONFIG”
- TRAINING_CONFIG_TYPE_TFEW_TRAINING_CONFIG = 'TFEW_TRAINING_CONFIG'¶
A constant which can be used with the training_config_type property of a TrainingConfig. This constant has a value of “TFEW_TRAINING_CONFIG”
- TRAINING_CONFIG_TYPE_VANILLA_TRAINING_CONFIG = 'VANILLA_TRAINING_CONFIG'¶
A constant which can be used with the training_config_type property of a TrainingConfig. This constant has a value of “VANILLA_TRAINING_CONFIG”
- __init__(**kwargs)¶
Initializes a new LoraTrainingConfig object with values from keyword arguments. The default value of the
training_config_typeattribute of this class isLORA_TRAINING_CONFIGand it should not be changed. The following keyword arguments are supported (corresponding to the getters/setters of this class):- Parameters
training_config_type (str) – The value to assign to the training_config_type property of this LoraTrainingConfig. Allowed values for this property are: “TFEW_TRAINING_CONFIG”, “VANILLA_TRAINING_CONFIG”, “LORA_TRAINING_CONFIG”
total_training_epochs (int) – The value to assign to the total_training_epochs property of this LoraTrainingConfig.
learning_rate (float) – The value to assign to the learning_rate property of this LoraTrainingConfig.
training_batch_size (int) – The value to assign to the training_batch_size property of this LoraTrainingConfig.
early_stopping_patience (int) – The value to assign to the early_stopping_patience property of this LoraTrainingConfig.
early_stopping_threshold (float) – The value to assign to the early_stopping_threshold property of this LoraTrainingConfig.
log_model_metrics_interval_in_steps (int) – The value to assign to the log_model_metrics_interval_in_steps property of this LoraTrainingConfig.
lora_r (int) – The value to assign to the lora_r property of this LoraTrainingConfig.
lora_alpha (int) – The value to assign to the lora_alpha property of this LoraTrainingConfig.
lora_dropout (float) – The value to assign to the lora_dropout property of this LoraTrainingConfig.
- property early_stopping_patience¶
Gets the early_stopping_patience of this TrainingConfig. Stop training if the loss metric does not improve beyond ‘early_stopping_threshold’ for this many times of evaluation.
- Returns
The early_stopping_patience of this TrainingConfig.
- Return type
int
- property early_stopping_threshold¶
Gets the early_stopping_threshold of this TrainingConfig. How much the loss must improve to prevent early stopping.
- Returns
The early_stopping_threshold of this TrainingConfig.
- Return type
float
- static get_subtype(object_dictionary)¶
Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
- property learning_rate¶
Gets the learning_rate of this TrainingConfig. The initial learning rate to be used during training
- Returns
The learning_rate of this TrainingConfig.
- Return type
float
- property log_model_metrics_interval_in_steps¶
Gets the log_model_metrics_interval_in_steps of this TrainingConfig. Determines how frequently to log model metrics.
Every step is logged for the first 20 steps and then follows this parameter for log frequency. Set to 0 to disable logging the model metrics.
- Returns
The log_model_metrics_interval_in_steps of this TrainingConfig.
- Return type
int
- property lora_alpha¶
Gets the lora_alpha of this LoraTrainingConfig. This parameter represents the scaling factor for the weight matrices in LoRA.
- Returns
The lora_alpha of this LoraTrainingConfig.
- Return type
int
- property lora_dropout¶
Gets the lora_dropout of this LoraTrainingConfig. This parameter indicates the dropout probability for LoRA layers.
- Returns
The lora_dropout of this LoraTrainingConfig.
- Return type
float
- property lora_r¶
Gets the lora_r of this LoraTrainingConfig. This parameter represents the LoRA rank of the update matrices.
- Returns
The lora_r of this LoraTrainingConfig.
- Return type
int
- property total_training_epochs¶
Gets the total_training_epochs of this TrainingConfig. The maximum number of training epochs to run for.
- Returns
The total_training_epochs of this TrainingConfig.
- Return type
int
- property training_batch_size¶
Gets the training_batch_size of this TrainingConfig. The batch size used during training.
- Returns
The training_batch_size of this TrainingConfig.
- Return type
int
- property training_config_type¶
[Required] Gets the training_config_type of this TrainingConfig. The fine-tuning method for training a custom model.
Allowed values for this property are: “TFEW_TRAINING_CONFIG”, “VANILLA_TRAINING_CONFIG”, “LORA_TRAINING_CONFIG”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
- Returns
The training_config_type of this TrainingConfig.
- Return type
str