Skip to content

Commit

Permalink
Merge pull request #94 from LucasAlegre/chore/remove_tensorboard_stuf…
Browse files Browse the repository at this point in the history
…f_make_gym_logging_optional

Chore/remove tensorboard stuff make gym logging optional
  • Loading branch information
ffelten authored Feb 16, 2024
2 parents b191a4a + d21f19d commit c145a11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 5 additions & 2 deletions morl_baselines/common/morl_algorithm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""MORL algorithm base classes."""
import os
import time
from abc import ABC, abstractmethod
from distutils.util import strtobool
from typing import Dict, Optional, Union

import gymnasium as gym
Expand Down Expand Up @@ -259,14 +261,15 @@ def setup_wandb(

config = self.get_config()
config["algo"] = self.experiment_name
# looks for whether we're using a Gymnasium based env in env_variable
monitor_gym = strtobool(os.environ.get("MONITOR_GYM", "True"))

wandb.init(
project=project_name,
entity=entity,
sync_tensorboard=True,
config=config,
name=self.full_experiment_name,
monitor_gym=True,
monitor_gym=monitor_gym,
save_code=True,
group=group,
)
Expand Down
8 changes: 3 additions & 5 deletions morl_baselines/multi_policy/linear_support/linear_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,11 @@ def _solve(w):

num_objectives = 2
ols = LinearSupport(num_objectives=num_objectives, epsilon=0.0001, verbose=True)
while True:
w = ols.next_weight()
if ols.ended():
print("OLS ended.")
break
w = ols.next_weight()
while not ols.ended():
print("w:", w)
value = _solve(w)
ols.add_solution(value, w)

print("hv:", hypervolume(np.zeros(num_objectives), ols.ccs))
w = ols.next_weight()

0 comments on commit c145a11

Please sign in to comment.