Skip to content

Workflow

Workflow

nazuna.workflow.Workflow dataclass

Class that holds the configuration for a workflow.

Attributes:

  • out_dir (str | Path = '') –

    Output path for for the workflow. Outputs config.toml and report.md here. Defaults to 'out/YYYYmmdd-HHMMSS/' if not specified.

    • If individual task output paths are not specified, subdirectories are created under this path using task names.
    • You may also create this directory in advance and place a config.toml inside it (it will be overwritten with the resolved config.toml). In that case, set exist_ok to True.
  • exist_ok (bool = True) –

    Whether to allow the output path to already exist.

  • data (dict = None) –

    Data configuration for TimeSeriesDataManager (required).

  • device (str = '') –

    Device name for computation (Ex. 'cpu', 'cuda'). If not specified, it will be automatically detected from your environment.

  • tasks (list[dict] = None) –

    List of individual task configurations (required). Each dict should have a 'task_type' key with a task type identifier (eval, train, optuna, diag), plus the required settings for that task type. See Reference (Task Runners) for details.

About individual task names when running a workflow

Task names are used in the following cases:

  • If an individual task's output path is not specified, a subdirectory is created. The subdirectory name is the task name with symbols converted to snake_case.
  • You can specify model_state.pth trained in previous tasks by task name.

Therefore, the following processing is done when creating a Workflow:

  • If a task name is not specified, it defaults to 'Task i' (0-indexed sequential number).
  • Duplicate task names are not allowed and will raise an error.