Skip to content

Commit

Permalink
feat: made checkpoint directory an argument in eval
Browse files Browse the repository at this point in the history
  • Loading branch information
harshkhandeparkar committed Dec 3, 2023
1 parent d8f6956 commit a0f7b9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openfasoc/MLoptimization/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def unlookup(norm_spec, goal_spec):
spec = -1*np.multiply((norm_spec+1), goal_spec)/(norm_spec-1)
return spec

def evaluate_model():
def evaluate_model(checkpoint_dir: str = "./last_checkpoint"):
specs = yaml.safe_load(Path('newnew_eval_3.yaml').read_text())

#training set up
Expand Down Expand Up @@ -47,7 +47,7 @@ def evaluate_model():
args = parser.parse_args()
env = Envir(env_config=env_config)

agent = PPO.from_checkpoint("./last_checkpoint")
agent = PPO.from_checkpoint(checkpoint_dir)

norm_spec_ref = env.global_g
spec_num = len(env.specs)
Expand Down

0 comments on commit a0f7b9f

Please sign in to comment.