nvflare.client.config module¶
- class ClientConfig(config: Dict | None = None)[source]¶
Bases:
object
Config class used in nvflare.client module.
Note
The config has the following keys:
EXCHANGE_FORMAT: Format to exchange, pytorch, raw, or numpy TRANSFER_TYPE: Either FULL or DIFF (means difference) TRAIN_WITH_EVAL: Whether train task needs to also do evaluation TRAIN_TASK_NAME: Name of the train task EVAL_TASK_NAME: Name of the evaluate task SUBMIT_MODEL_TASK_NAME: Name of the submit_model task PIPE_CHANNEL_NAME: Channel name of the pipe PIPE: pipe section CLASS_NAME: Class name ARG: Arguments SITE_NAME: Site name JOB_ID: Job id TASK_EXCHANGE: TASK_EXCHANGE section METRICS_EXCHANGE: METRICS_EXCHANGE section
Example
The content of config looks like:
{ "METRICS_EXCHANGE": { "pipe_channel_name": "metric", "pipe": { "CLASS_NAME": "nvflare.fuel.utils.pipe.cell_pipe.CellPipe", "ARG": { "mode": "ACTIVE", "site_name": "site-1", "token": "simulate_job", "root_url": "tcp://0:51893", "secure_mode": false, "workspace_dir": "xxx" } } }, "SITE_NAME": "site-1", "JOB_ID": "simulate_job", "TASK_EXCHANGE": { "train_with_eval": true, "exchange_format": "numpy", "transfer_type": "DIFF", "train_task_name": "train", "eval_task_name": "validate", "submit_model_task_name": "submit_model", "pipe_channel_name": "task", "pipe": { "CLASS_NAME": "nvflare.fuel.utils.pipe.cell_pipe.CellPipe", "ARG": { "mode": "ACTIVE", "site_name": "site-1", "token": "simulate_job", "root_url": "tcp://0:51893", "secure_mode": false, "workspace_dir": "xxx" } } } }
- class ConfigKey[source]¶
Bases:
object
- ARG = 'ARG'¶
- CLASS_NAME = 'CLASS_NAME'¶
- EVAL_TASK_NAME = 'eval_task_name'¶
- EXCHANGE_FORMAT = 'exchange_format'¶
- HEARTBEAT_TIMEOUT = 'HEARTBEAT_TIMEOUT'¶
- METRICS_EXCHANGE = 'METRICS_EXCHANGE'¶
- PIPE = 'pipe'¶
- PIPE_CHANNEL_NAME = 'pipe_channel_name'¶
- SUBMIT_MODEL_TASK_NAME = 'submit_model_task_name'¶
- TASK_EXCHANGE = 'TASK_EXCHANGE'¶
- TASK_NAME = 'TASK_NAME'¶
- TRAIN_TASK_NAME = 'train_task_name'¶
- TRAIN_WITH_EVAL = 'train_with_eval'¶
- TRANSFER_TYPE = 'transfer_type'¶