-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbenchmark.py
More file actions
25 lines (20 loc) · 788 Bytes
/
benchmark.py
File metadata and controls
25 lines (20 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import random
import numpy as np
import torch
import yaml
from train import Trainer
if __name__ == "__main__":
train_configs:dict = yaml.safe_load(open("train_config.yaml"))
seed = train_configs.get('seed', 1)
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
num_run = 3
for runtime in range(num_run):
for power in [1, 5]:
for algorithm in ["Random", "LearnInterfaceAndPower", "LearnInterface", "RAQL"]:
P_sum = pow(10, power/10)*1e-3
train_configs['env_config']['P_sum'] = P_sum
train_configs['env_config']['algorithm'] = algorithm
trainer = Trainer(train_configs)
trainer.train(run_name=f'{algorithm}_{power}dbm_{runtime}')