siml.services package¶
Subpackages¶
- siml.services.inference package
- Subpackages
- Submodules
- siml.services.inference.core_inferer module
- siml.services.inference.data_loader_builder module
- siml.services.inference.engine_builder module
- siml.services.inference.inner_setting module
InnerInfererSetting
InnerInfererSetting.Config
InnerInfererSetting.conversion_setting
InnerInfererSetting.create_model_env_setting()
InnerInfererSetting.decrypt_key
InnerInfererSetting.force_converter_parameters_pkl
InnerInfererSetting.force_model_path
InnerInfererSetting.get_converter_parameters_pkl_path()
InnerInfererSetting.get_crypt_key()
InnerInfererSetting.get_model_name()
InnerInfererSetting.get_output_directory()
InnerInfererSetting.get_snapshot_file_path()
InnerInfererSetting.get_write_simulation_case_dir()
InnerInfererSetting.inferer_setting
InnerInfererSetting.load_scalers()
InnerInfererSetting.main_setting
InnerInfererSetting.model_setting
InnerInfererSetting.perform_inverse
InnerInfererSetting.skip_fem_data_creation()
InnerInfererSetting.trainer_setting
- siml.services.inference.metrics_builder module
- siml.services.inference.record_object module
PostPredictionRecord
PostPredictionRecord.data_directory
PostPredictionRecord.dict_answer
PostPredictionRecord.dict_x
PostPredictionRecord.dict_y
PostPredictionRecord.fem_data
PostPredictionRecord.inference_start_datetime
PostPredictionRecord.inference_time
PostPredictionRecord.loss
PostPredictionRecord.original_shapes
PostPredictionRecord.output_directory
PostPredictionRecord.raw_loss
PredictionRecord
RawPredictionRecord
- Module contents
- siml.services.training package
- Subpackages
- Submodules
- siml.services.training.data_loader_builder module
- siml.services.training.engine_builder module
- siml.services.training.events_assigners module
- siml.services.training.inner_settings module
- siml.services.training.metrics_builder module
- siml.services.training.tensor_spliter module
- siml.services.training.trainers_builder module
- siml.services.training.training_logger module
- Module contents
Submodules¶
siml.services.environment module¶
- class siml.services.environment.ModelEnvironmentSetting(gpu_id: int, seed: int, data_parallel: bool, model_parallel: bool, time_series: bool)¶
Bases:
object
This class has information of model environments. In the future, this class is deprecated and integrated to MainSetting
- data_parallel: bool¶
- get_device() str ¶
- get_output_device() str ¶
- property gpu_count: int¶
- gpu_id: int¶
- model_parallel: bool¶
- seed: int¶
- set_seed() None ¶
- time_series: bool¶
siml.services.model_builder module¶
- class siml.services.model_builder.ModelBuilder(model_setting: ModelSetting, trainer_setting: TrainerSetting, env_setting: ModelEnvironmentSetting)¶
Bases:
object
- create_initialized() Network ¶
Create initialized network object
- Returns:
network object
- Return type:
networks.Network
- create_loaded(checkpoint_file: Path, decrypt_key: bytes | None = None) Network ¶
Create network object loaded from checkpoint file
- Parameters:
checkpoint_file (pathlib.Path) – Path to checkpoint file
decrypt_key (Optional[bytes], optional) – decrpt byte key, by default None
- Returns:
network object
- Return type:
networks.Network
- property state_dict_strict: bool¶
siml.services.model_selector module¶
- class siml.services.model_selector.BestModelSelector¶
Bases:
IModelSelector
- static select_model(dir_path: Path, **kwards) ISimlCheckpointFile ¶
- class siml.services.model_selector.DeployedModelSelector¶
Bases:
IModelSelector
- static select_model(dir_path: Path, **kwards) ISimlCheckpointFile ¶
- class siml.services.model_selector.IModelSelector¶
Bases:
object
- abstract static select_model(dir_path: Path, **kwards) ISimlCheckpointFile ¶
- class siml.services.model_selector.LatestModelSelector¶
Bases:
IModelSelector
- static select_model(dir_path: Path, **kwards) ISimlCheckpointFile ¶
- class siml.services.model_selector.ModelSelectorBuilder¶
Bases:
object
- static create(selection_name: str) IModelSelector ¶
- class siml.services.model_selector.SpecifiedModelSelector¶
Bases:
IModelSelector
- static select_model(dir_path: Path, *, infer_epoch: int, **kwards) ISimlCheckpointFile ¶
- class siml.services.model_selector.TrainBestModelSelector¶
Bases:
IModelSelector
- static select_model(dir_path: Path, **kwards) ISimlCheckpointFile ¶
siml.services.path_rules module¶
- class siml.services.path_rules.SimlPathRules(_type_to_name: mappingproxy = mappingproxy({<DirectoryType.RAW: 0>: 'raw', <DirectoryType.INTERIM: 1>: 'interim', <DirectoryType.PREPROCESSED: 2>: 'preprocessed'}))¶
Bases:
object
- common_parent(directory_1: Path, directory_2: Path) Path ¶
Search common parent directory
- Parameters:
directory_1 (pathlib.Path) –
directory_2 (pathlib.Path) –
- Returns:
common_parent – Path to common parent directory
- Return type:
pathlib.Path
- detect_directory_type(data_directory: Path) DirectoryType | None ¶
- determine_output_directory(data_directory: Path, output_base_directory: Path, *, allowed_type: DirectoryType | None = None) Path ¶
- Determine output directory by replacing a string
in the input_directory according to directory type of data directory.
- Parameters:
input_directory (pathlib.Path) – Input directory path.
output_base_directory (pathlib.Path) – Output base directory path. The output directry name is under that directory.
- Returns:
output_directory – Detemined output directory path.
- Return type:
pathlib.Path
Examples
input_direcotry = “./aaa/bbb/interim/ddd” output_base_directory = “./aaa/ccc”
output_directory = “./aaa/ccc/bbb/ddd”
- determine_write_simulation_case_dir(data_directory: Path, write_simulation_base: Path | None = None) Path | None ¶
- is_target_directory_type(data_directory: Path, dir_type: DirectoryType) bool ¶
- switch_directory_type(directory: Path, dir_type_to: DirectoryType) Path ¶