Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aramoto99 committed Feb 7, 2025
1 parent a3aaba5 commit f1059cb
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
7 changes: 3 additions & 4 deletions aiaccel/hpo/apps/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ def main() -> None:
executor:
_target_: aiaccel.hpo.job_executors.LocalJobExecutor
n_max_jobs: 4
result:
_target_: aiaccel.hpo.job_output_loaders.JsonJobOutputLoader
filename_template: "{job.cwd}/{job.job_name}_result.json"
loader:
_target_: aiaccel.hpo.job_output_loaders.JsonJobOutputLoader
filename_template: "{job.cwd}/{job.job_name}_result.json"
params:
_convert_: partial
Expand Down
2 changes: 1 addition & 1 deletion aiaccel/hpo/job_output_loaders/json_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class JsonJobOutputLoader(BaseJobOutputLoader):
__init__(filename_template: str) -> None:
Initializes the JsonJobOutputLoader with a filename template.
load(job: BaseJobExecutor) -> int | float | str:
load(job: BaseJob) -> int | float | str:
Loads the result from a JSON file based on the job information.
"""

Expand Down
2 changes: 1 addition & 1 deletion aiaccel/hpo/job_output_loaders/pickle_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PickleJobOutputLoader(BaseJobOutputLoader):
__init__(filename_template: str) -> None:
Initializes the PickleJobOutputLoader with a filename template.
load(job: BaseJobExecutor) -> int | float | str:
load(job: BaseJob) -> int | float | str:
Loads the result from a pickle file corresponding to the given job.
"""

Expand Down
2 changes: 1 addition & 1 deletion aiaccel/hpo/job_output_loaders/stdout_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class StdoutJobOutputLoader(BaseJobOutputLoader):
filename_template (str): A template for the filename where the results are stored.
Methods:
load(job: BaseJobExecutor) -> int | float | str:
load(job: BaseJob) -> int | float | str:
Loads the result from the file corresponding to the given job.
The result is expected to be on the last non-empty line of the file.
Returns the result as an integer, float, or string, depending on the content.
Expand Down
31 changes: 18 additions & 13 deletions docs/source/user_guide/hpo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ Basic configuration example:
executor:
_target_: aiaccel.hpo.job_executors.LocalJobExecutor
n_max_jobs: 4
result:
_target_: aiaccel.hpo.job_output_loaders.JsonResult
filename_template: "{job.cwd}/{job.job_name}_result.json"
loader:
_target_: aiaccel.hpo.job_output_loaders.JsonResult
filename_template: "{job.cwd}/{job.job_name}_result.json"
params:
x1: [0, 1]
Expand Down Expand Up @@ -124,9 +123,11 @@ JSON Format (Default):

.. code-block:: yaml
result:
_target_: aiaccel.hpo.job_output_loaders.JsonResult
filename_template: "{job.cwd}/{job.job_name}_result.json"
executor:
...
loader:
_target_: aiaccel.hpo.job_output_loaders.JsonResult
filename_template: "{job.cwd}/{job.job_name}_result.json"
Example objective function for JSON:

Expand All @@ -147,9 +148,11 @@ Pickle Format:

.. code-block:: yaml
result:
_target_: aiaccel.hpo.job_output_loaders.PickleResult
filename_template: "{job.cwd}/{job.job_name}_result.pkl"
executor:
...
loader:
_target_: aiaccel.hpo.job_output_loaders.PickleResult
filename_template: "{job.cwd}/{job.job_name}_result.pkl"
Example objective function for Pickle:

Expand All @@ -170,9 +173,11 @@ Stdout Format:

.. code-block:: yaml
result:
_target_: aiaccel.hpo.job_output_loaders.StdoutResult
filename_template: "{job.cwd}/{job.job_name}_result.txt"
executor:
...
loader:
_target_: aiaccel.hpo.job_output_loaders.StdoutResult
filename_template: "{job.cwd}/{job.job_name}_result.txt"
Example objective function for Stdout:

Expand Down

0 comments on commit f1059cb

Please sign in to comment.