Skip to content

Commit

Permalink
remove debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
Enrico-Call committed Apr 17, 2024
1 parent ca297c1 commit 117f0fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions modcmac_code/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def generate_proportionally_weighted_states(n_components, start_states, probs, r
return np.array(random.choices(start_states, weights=adjusted_weights, k=n_components))


def weibull_interpolation(P, P_start, ndeterioration, lambda_=92, kappa=2):
def weibull_interpolation(P, P_start, ndeterioration, lambda_=92, kappa=2.5):
"""
Adjust the transition matrix over time using a Weibull distribution, where the probability
of moving to a higher state increases, and the probability of staying in the same state decreases.
Expand Down Expand Up @@ -178,7 +178,6 @@ def weibull_interpolation(P, P_start, ndeterioration, lambda_=92, kappa=2):

P[t] = P_copy

print(list(P[-1].round(3)))
return P


Expand Down
3 changes: 2 additions & 1 deletion run_MODCMAC.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def parse_arguments():
parser.add_argument("--device", type=str, default="cpu", help="Device.", choices=["cpu", "cuda", "mps"])
parser.add_argument("--save_folder", type=str, default="./models", help="Folder to save models.")
parser.add_argument("--do_eval", action='store_true', help="Flag to do evaluation.")
parser.add_argument('--eval_steps', type=int, default=5, help='Number of evaluation steps to perform.')
parser.add_argument("--path_pnet", type=str, default=None, help="Path to policy network.")
parser.add_argument("--path_vnet", type=str, default=None, help="Path to value network.")
parser.add_argument("--no_log", action="store_false", help="Flag to not log the run")
Expand Down Expand Up @@ -125,7 +126,7 @@ def signal_handler(sig, frame):
agent.train(training_steps=args.num_steps)
else:
agent.load_model(args.path_pnet, args.path_vnet)
cost_array, risk_array, uti_array, scoring_table = agent.do_eval(5)
cost_array, risk_array, uti_array, scoring_table = agent.do_eval(args.eval_steps)
print("Cost: ", np.mean(cost_array))
print("Risk: ", np.mean(risk_array))
print("Utility: ", np.mean(uti_array))
Expand Down

0 comments on commit 117f0fb

Please sign in to comment.