CHAI是加州大学伯克利分校的模仿和奖励学习算法(逆RL)框架>(https://github.com/HumanCompatibleAI/imitation)
我无法为
imitation
库启用日志记录和 Tensorboard。这是 logger
实用程序 - 感谢任何帮助。
https://imitation.readthedocs.io/en/latest/_api/imitation.util.logger.html
我弄清楚了这个机制并将其发布在这里供其他可能感兴趣的人:
from imitation.algorithms import bc
from imitation.util import logger as imit_logger
# Set new logger
log_path = '/irl_log/'
logger_irl = imit_logger.configure(log_path, ["stdout", "csv", "tensorboard"])
bc_trainer = bc.BC(
observation_space=mt_venv.observation_space,
action_space=mt_venv.action_space,
demonstrations=transitions,
rng=rng,
device='cpu',
custom_logger = logger_irl
)