Image Classification Parameters
class autotrain.trainers.image_classification.params.ImageClassificationParams
< source >( data_path: str = None model: str = 'google/vit-base-patch16-224' username: Optional = None lr: float = 5e-05 epochs: int = 3 batch_size: int = 8 warmup_ratio: float = 0.1 gradient_accumulation: int = 1 optimizer: str = 'adamw_torch' scheduler: str = 'linear' weight_decay: float = 0.0 max_grad_norm: float = 1.0 seed: int = 42 train_split: str = 'train' valid_split: Optional = None logging_steps: int = -1 project_name: str = 'project-name' auto_find_batch_size: bool = False mixed_precision: Optional = None save_total_limit: int = 1 token: Optional = None push_to_hub: bool = False eval_strategy: str = 'epoch' image_column: str = 'image' target_column: str = 'target' log: str = 'none' early_stopping_patience: int = 5 early_stopping_threshold: float = 0.01 )
Parameters
- data_path (str) — Path to the dataset.
- model (str) — Pre-trained model name or path. Default is “google/vit-base-patch16-224”.
- username (Optional[str]) — Hugging Face account username.
- lr (float) — Learning rate for the optimizer. Default is 5e-5.
- epochs (int) — Number of epochs for training. Default is 3.
- batch_size (int) — Batch size for training. Default is 8.
- warmup_ratio (float) — Warmup ratio for learning rate scheduler. Default is 0.1.
- gradient_accumulation (int) — Number of gradient accumulation steps. Default is 1.
- optimizer (str) — Optimizer type. Default is “adamw_torch”.
- scheduler (str) — Learning rate scheduler type. Default is “linear”.
- weight_decay (float) — Weight decay for the optimizer. Default is 0.0.
- max_grad_norm (float) — Maximum gradient norm for clipping. Default is 1.0.
- seed (int) — Random seed for reproducibility. Default is 42.
- train_split (str) — Name of the training data split. Default is “train”.
- valid_split (Optional[str]) — Name of the validation data split.
- logging_steps (int) — Number of steps between logging. Default is -1.
- project_name (str) — Name of the project for output directory. Default is “project-name”.
- auto_find_batch_size (bool) — Automatically find optimal batch size. Default is False.
- mixed_precision (Optional[str]) — Mixed precision training mode (fp16, bf16, or None).
- save_total_limit (int) — Maximum number of checkpoints to keep. Default is 1.
- token (Optional[str]) — Hugging Face Hub token for authentication.
- push_to_hub (bool) — Whether to push the model to Hugging Face Hub. Default is False.
- eval_strategy (str) — Evaluation strategy during training. Default is “epoch”.
- image_column (str) — Column name for images in the dataset. Default is “image”.
- target_column (str) — Column name for target labels in the dataset. Default is “target”.
- log (str) — Logging method for experiment tracking. Default is “none”.
- early_stopping_patience (int) — Number of epochs with no improvement for early stopping. Default is 5.
- early_stopping_threshold (float) — Threshold for early stopping. Default is 0.01.
ImageClassificationParams is a configuration class for image classification training parameters.