NlpFixedParameters Class

Configuration of fixed parameters for all candidates of an AutoML NLP Job

Inheritance
azure.ai.ml.entities._mixins.RestTranslatableMixin
NlpFixedParameters

Constructor

NlpFixedParameters(*, gradient_accumulation_steps: int | None = None, learning_rate: float | None = None, learning_rate_scheduler: str | None = None, model_name: str | None = None, number_of_epochs: int | None = None, training_batch_size: int | None = None, validation_batch_size: int | None = None, warmup_ratio: float | None = None, weight_decay: float | None = None)

Parameters

Name Description
gradient_accumulation_steps
Required

number of steps over which to accumulate gradients before a backward pass. This must be a positive integer, defaults to None

learning_rate
Required

initial learning rate. Must be a float in (0, 1), defaults to None

learning_rate_scheduler
Required

the type of learning rate scheduler. Must choose from 'linear', 'cosine', 'cosine_with_restarts', 'polynomial', 'constant', and 'constant_with_warmup', defaults to None

model_name
Required

the model name to use during training. Must choose from 'bert-base-cased', 'bert-base-uncased', 'bert-base-multilingual-cased', 'bert-base-german-cased', 'bert-large-cased', 'bert-large-uncased', 'distilbert-base-cased', 'distilbert-base-uncased', 'roberta-base', 'roberta-large', 'distilroberta-base', 'xlm-roberta-base', 'xlm-roberta-large', xlnet-base-cased', and 'xlnet-large-cased', defaults to None

number_of_epochs
Required

the number of epochs to train with. Must be a positive integer, defaults to None

training_batch_size
Required

the batch size during training. Must be a positive integer, defaults to None

validation_batch_size
Required

the batch size during validation. Must be a positive integer, defaults to None

warmup_ratio
Required

ratio of total training steps used for a linear warmup from 0 to learning_rate. Must be a float in [0, 1], defaults to None

weight_decay
Required

value of weight decay when optimizer is sgd, adam, or adamw. This must be a float in the range [0, 1] defaults to None

Keyword-Only Parameters

Name Description
gradient_accumulation_steps
Required
learning_rate
Required
learning_rate_scheduler
Required
model_name
Required
number_of_epochs
Required
training_batch_size
Required
validation_batch_size
Required
warmup_ratio
Required
weight_decay
Required

Examples

creating an nlp fixed parameters


   from azure.ai.ml import automl
   from azure.ai.ml.constants import NlpLearningRateScheduler

   nlp_fixed_parameters = automl.NlpFixedParameters(
       model_name="roberta-base",
       learning_rate_scheduler=NlpLearningRateScheduler.LINEAR,
       warmup_ratio=0.1,
   )