flip.nvflare.executors ====================== .. py:module:: flip.nvflare.executors .. autoapi-nested-parse:: FLIP Executors module containing NVFLARE executor wrappers. These executors wrap user-provided training, validation, and evaluation logic. Exports: - RUN_TRAINER: Wrapper executor for user's FLIP_TRAINER class - RUN_VALIDATOR: Wrapper executor for user's FLIP_VALIDATOR class - RUN_EVALUATOR: Wrapper executor for user's FLIP_EVALUATOR class Submodules ---------- .. toctree:: :maxdepth: 1 /reference/api/flip/nvflare/executors/evaluator/index /reference/api/flip/nvflare/executors/trainer/index /reference/api/flip/nvflare/executors/validator/index Classes ------- .. autoapisummary:: flip.nvflare.executors.RUN_EVALUATOR flip.nvflare.executors.RUN_TRAINER flip.nvflare.executors.RUN_VALIDATOR Package Contents ---------------- .. py:class:: RUN_EVALUATOR(evaluate_task_name=PTConstants.EvalTaskName, project_id='', query='') Bases: :py:obj:`nvflare.apis.executor.Executor` Executes the uploaded evaluator and handles any errors. .. py:method:: execute(task_name: str, shareable: nvflare.apis.shareable.Shareable, fl_ctx: nvflare.apis.fl_context.FLContext, abort_signal: nvflare.apis.signal.Signal) -> nvflare.apis.shareable.Shareable .. py:class:: RUN_TRAINER(train_task_name=AppConstants.TASK_TRAIN, submit_model_task_name=AppConstants.TASK_SUBMIT_MODEL, exclude_vars=None, project_id='', query='') Bases: :py:obj:`nvflare.apis.executor.Executor` Wrapper executor that runs user-provided FLIP_TRAINER implementations. This executor handles: - Dynamic importing of the user's FLIP_TRAINER class - Error handling and exception logging - Lazy initialization of the trainer instance Initialize the RUN_TRAINER executor. :param train_task_name: Task name for train task. Defaults to "train". :param submit_model_task_name: Task name for submit model. Defaults to "submit_model". :param exclude_vars: List of variables to exclude during model loading. :param project_id: The ID of the project the model belongs to. :param query: The cohort query that is associated with the project. .. py:method:: execute(task_name: str, shareable: nvflare.apis.shareable.Shareable, fl_ctx: nvflare.apis.fl_context.FLContext, abort_signal: nvflare.apis.signal.Signal) -> nvflare.apis.shareable.Shareable Execute the training task. This method: 1. Lazily imports and initializes the user's FLIP_TRAINER 2. Delegates execution to the user's trainer 3. Catches and reports any exceptions :param task_name: The name of the task to execute :param shareable: The input shareable data :param fl_ctx: The FL context :param abort_signal: Signal for aborting the task :returns: *Shareable* -- The result of the training task .. py:class:: RUN_VALIDATOR(validate_task_name=AppConstants.TASK_VALIDATION, project_id='', query='') Bases: :py:obj:`nvflare.apis.executor.Executor` Wrapper executor that runs user-provided FLIP_VALIDATOR implementations. This executor handles: - Dynamic importing of the user's FLIP_VALIDATOR class - Error handling and exception logging - Lazy initialization of the validator instance Initialize the RUN_VALIDATOR executor. :param validate_task_name: Task name for validation task. Defaults to "validate". :param project_id: The ID of the project the model belongs to. :param query: The cohort query that is associated with the project. .. py:method:: execute(task_name: str, shareable: nvflare.apis.shareable.Shareable, fl_ctx: nvflare.apis.fl_context.FLContext, abort_signal: nvflare.apis.signal.Signal) -> nvflare.apis.shareable.Shareable Execute the validation task. This method: 1. Lazily imports and initializes the user's FLIP_VALIDATOR 2. Delegates execution to the user's validator 3. Catches and reports any exceptions :param task_name: The name of the task to execute :param shareable: The input shareable data :param fl_ctx: The FL context :param abort_signal: Signal for aborting the task :returns: *Shareable* -- The result of the validation task