phlower.settings.PhlowerPredictorSetting¶
- class phlower.settings.PhlowerPredictorSetting(*, selection_mode, device='cpu', log_file_name='log', saved_setting_filename='model', batch_size=1, num_workers=0, non_blocking=False, pin_memory=False, random_seed=0, target_epoch=None, output_to_scaler_name=<factory>, use_inference_mode=True)[source]¶
Bases:
BaseModel
Methods
check_valid_selection_mode
(name)check_valid_target_epoch
()Attributes
model_computed_fields
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
model_extra
Get extra fields set during validation.
model_fields
model_fields_set
Returns the set of fields that have been explicitly set on this model instance.
Define method to select checkpoint file.
device name.
name of log file.
file name of pretrained model setting.
batch size.
the number of cores.
If True, the data transfer is non-blocking.
If True, the data loader uses pin_memory.
random seed.
target_epoch specifies the number of snapshot.
output_to_scaler_name is a dictionary to define the scaler
If True, use torch.inference_mode() for prediction.
- Parameters:
selection_mode (str)
device (str)
log_file_name (str)
saved_setting_filename (str)
batch_size (int)
num_workers (int)
non_blocking (bool)
pin_memory (bool)
random_seed (int)
target_epoch (int | None)
output_to_scaler_name (dict[str, str])
use_inference_mode (bool)
- batch_size: int¶
batch size. Defaults to 1
- device: str¶
device name. Defaults to cpu
- log_file_name: str¶
name of log file. Defaults to “log”
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- non_blocking: bool¶
If True, the data transfer is non-blocking. Defaults to False.
- num_workers: int¶
the number of cores. Defaults to 0
- output_to_scaler_name: dict[str, str]¶
- output_to_scaler_name is a dictionary to define the scaler
for each output variable. The key is the name of the output variable
and the value is the name of variable which has the scaler to use. Defaults to empty dictionary, relationship between output variable
and scaler is assumed to be the same as that of label variables.
- pin_memory: bool¶
If True, the data loader uses pin_memory. Defaults to False.
- random_seed: int¶
random seed. Defaults to 0
- saved_setting_filename: str¶
file name of pretrained model setting. Defaults to “model”
- selection_mode: str¶
Define method to select checkpoint file. Choose from “best”, “latest”, “train_best”, “specified”
- target_epoch: int | None¶
target_epoch specifies the number of snapshot. Defaults to None.
- use_inference_mode: bool¶
If True, use torch.inference_mode() for prediction. Defaults to True.