-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
246 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
import json | ||
|
||
from aiaccel.hpo.job_executors import BaseJobExecutor | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
import pickle as pkl | ||
|
||
from aiaccel.hpo.job_executors import BaseJobExecutor | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
study: | ||
_target_: optuna.create_study | ||
direction: minimize | ||
study_name: my_study | ||
load_if_exists: false | ||
sampler: | ||
_target_: optuna.samplers.TPESampler | ||
seed: 0 | ||
|
||
result: | ||
_target_: aiaccel.hpo.results.JsonResult | ||
filename_template: "{job.cwd}/{job.job_name}_result.json" | ||
|
||
params: | ||
_convert_: partial | ||
_target_: aiaccel.hpo.apps.optimize.HparamsManager | ||
x1: [0, 1] | ||
x2: | ||
_target_: aiaccel.hpo.optuna.suggest_wrapper.SuggestFloat | ||
name: x2 | ||
low: 0.0 | ||
high: 1.0 | ||
log: false | ||
|
||
n_trials: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
study: | ||
_target_: optuna.create_study | ||
direction: minimize | ||
study_name: my_study | ||
load_if_exists: false | ||
sampler: | ||
_target_: optuna.samplers.TPESampler | ||
seed: 0 | ||
|
||
result: | ||
_target_: aiaccel.hpo.results.PickleResult | ||
filename_template: "{job.cwd}/{job.job_name}_result.pkl" | ||
|
||
params: | ||
_convert_: partial | ||
_target_: aiaccel.hpo.apps.optimize.HparamsManager | ||
x1: [0, 1] | ||
x2: | ||
_target_: aiaccel.hpo.optuna.suggest_wrapper.SuggestFloat | ||
name: x2 | ||
low: 0.0 | ||
high: 1.0 | ||
log: false | ||
|
||
n_trials: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
study: | ||
_target_: optuna.create_study | ||
direction: minimize | ||
study_name: my_study | ||
load_if_exists: false | ||
sampler: | ||
_target_: optuna.samplers.TPESampler | ||
seed: 0 | ||
|
||
result: | ||
_target_: aiaccel.hpo.results.StdoutResult | ||
filename_template: "{job.cwd}/{job.job_name}_result.txt" | ||
|
||
params: | ||
_convert_: partial | ||
_target_: aiaccel.hpo.apps.optimize.HparamsManager | ||
x1: [0, 1] | ||
x2: | ||
_target_: aiaccel.hpo.optuna.suggest_wrapper.SuggestFloat | ||
name: x2 | ||
low: 0.0 | ||
high: 1.0 | ||
log: false | ||
|
||
n_trials: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from argparse import ArgumentParser | ||
import json | ||
from pathlib import Path | ||
|
||
|
||
def main() -> None: | ||
parser = ArgumentParser() | ||
parser.add_argument("dst_filename", type=Path) | ||
parser.add_argument("--x1", type=float) | ||
parser.add_argument("--x2", type=float) | ||
args = parser.parse_args() | ||
|
||
x1, x2 = args.x1, args.x2 | ||
|
||
y = (x1**2) - (4.0 * x1) + (x2**2) - x2 - (x1 * x2) | ||
|
||
with open(args.dst_filename, "w") as f: | ||
json.dump({"objective": y}, f) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
#$-l rt_C.small=1 | ||
#$-cwd | ||
|
||
source /etc/profile.d/modules.sh | ||
module load gcc/13.2.0 | ||
module load python/3.10/3.10.14 | ||
|
||
python objective_for_json_test.py $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from argparse import ArgumentParser | ||
from pathlib import Path | ||
import pickle as pkl | ||
|
||
|
||
def main() -> None: | ||
parser = ArgumentParser() | ||
parser.add_argument("dst_filename", type=Path) | ||
parser.add_argument("--x1", type=float) | ||
parser.add_argument("--x2", type=float) | ||
args = parser.parse_args() | ||
|
||
x1, x2 = args.x1, args.x2 | ||
|
||
y = (x1**2) - (4.0 * x1) + (x2**2) - x2 - (x1 * x2) | ||
|
||
with open(args.dst_filename, "wb") as f: | ||
pkl.dump(y, f) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
#$-l rt_C.small=1 | ||
#$-cwd | ||
|
||
source /etc/profile.d/modules.sh | ||
module load gcc/13.2.0 | ||
module load python/3.10/3.10.14 | ||
|
||
python objective_for_pkl_test.py $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from argparse import ArgumentParser | ||
|
||
|
||
def main() -> None: | ||
parser = ArgumentParser() | ||
parser.add_argument("--x1", type=float) | ||
parser.add_argument("--x2", type=float) | ||
args = parser.parse_args() | ||
|
||
x1, x2 = args.x1, args.x2 | ||
|
||
y = (x1**2) - (4.0 * x1) + (x2**2) - x2 - (x1 * x2) | ||
|
||
print(y) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
#$-l rt_C.small=1 | ||
#$-cwd | ||
|
||
source /etc/profile.d/modules.sh | ||
module load gcc/13.2.0 | ||
module load python/3.10/3.10.14 | ||
|
||
python objective_for_stdo_test.py "${@:2}" > "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters