Skip to content

Commit

Permalink
update docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshipon committed Feb 5, 2025
1 parent 6e03b96 commit 447425d
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions aiaccel/torch/apps/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,27 @@

def main() -> None:
"""
Main function to execute the training process.
This function parses command-line arguments to get the configuration file
and working directory, loads and merges configuration settings from various
sources, prints the configuration if the process is the main one, saves the
configuration to a file, and then initiates the training process using the
specified trainer, model, and datamodule.
Execute the training process using a configuration file.
This function:
1. Parses command-line arguments to get the configuration file and working directory.
2. Loads and merges configurations from the YAML file, command-line arguments, and default settings.
3. Prints the final configuration.
4. Saves the merged configuration to a file (`${working_directory}/config_merged.yaml`).
5. Instantiates and runs the training process using the specified trainer, model, and datamodule.
Command-line Arguments:
config (Path): Path to the configuration file in YAML format.
--working_directory (Path): Path to the working directory (default is the current working directory).
Raises:
FileNotFoundError: If the configuration file does not exist.
Exception: If there is an error during the training process.
config (Path): Path to the YAML configuration file.
--working_directory (Path, optional): Path to the working directory (default: current working directory).
Usage:
Usage Example:
```bash
python -m aiaccel.torch.apps.train config.yaml --working_directory /path/to/working/directory
```
You can also update some configurations from CLI as follows:
```bash
python -m aiaccel.torch.apps.train config.yaml task.hparam1=1.0 task.hparam2=2.0 ...
```
"""

parser = ArgumentParser()
Expand Down

0 comments on commit 447425d

Please sign in to comment.