cpa.CPA.train#
- CPA.train(max_epochs=None, use_gpu=None, train_size=0.9, validation_size=None, batch_size=128, plan_kwargs=None, save_path=None, check_val_every_n_epoch=10, early_stopping_patience=10, **trainer_kwargs)[source]#
Trains CPA on the given dataset
- Parameters:
- max_epochs int
Maximum number of epochs for training
- use_gpu bool
Whether to use GPU if available
- train_size float
- Fraction of training data in the case of randomly splitting dataset to train/valdiation
if split_key is not set in model’s constructor
- validation_size float
- Fraction of validation data in the case of randomly splitting dataset to train/valdiation
if split_key is not set in model’s constructor
- batch_size int
Size of mini-batches for training
- early_stopping bool
If True, EarlyStopping will be used during training on validation dataset
- plan_kwargs dict
CPATrainingPlan parameters
- save_path str
Path to save the model after the end of training
- check_val_every_n_epoch int
How often to check validation metrics
- early_stopping_patience int
Patience for early stopping
- **trainer_kwargs
Additional parameters for cpa.CPATrainingPlan