functional
adarul_from_config(config, pre_trainer_kwargs=None, trainer_kwargs=None)
Construct an ADARUL approach from a configuration.
The configuration can be created by calling get_adarul_config.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
DictConfig
|
The ADARUL config. |
required |
pre_trainer_kwargs |
Optional[Dict[str, Any]]
|
Overrides for the pre-training trainer class. |
None
|
trainer_kwargs |
Optional[Dict[str, Any]]
|
Overrides for the main trainer class. |
None
|
Returns: pre: The data module, approach and trainer for the pre-training stage main: The data module, approach, domain discriminator and trainer for the main stage
get_adarul(source_fd, target_fd, pre_trainer_kwargs=None, trainer_kwargs=None)
Construct an ADARUL approach with the original hyperparameters on CMAPSS.
Examples:
>>> import rul_adapt
>>> pre, main = rul_adapt.construct.get_adarul(, 3, 1)
>>> pre_dm, pre_approach, pre_trainer = pre
>>> dm, approach, domain_disc, trainer = main
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_fd |
int
|
The source FD of CMAPSS. |
required |
target_fd |
int
|
The target FD of CMAPSS. |
required |
pre_trainer_kwargs |
Optional[Dict[str, Any]]
|
Overrides for the pre-training trainer class. |
None
|
trainer_kwargs |
Optional[Dict[str, Any]]
|
Overrides for the main trainer class. |
None
|
Returns: pre: The data module, approach and trainer for the pre-training stage main: The data module, approach, domain discriminator and trainer for the main stage
get_adarul_config(source_fd, target_fd)
Get a configuration for the ADARUL approach.
The configuration can be modified and fed to adarul_from_config to create the approach.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_fd |
int
|
The source FD of CMAPSS. |
required |
target_fd |
int
|
The target FD of CMAPSS. |
required |
Returns: The ADARUL configuration.