Skip to content

Commit 77c85db

Browse files
author
Jan Michelfeit
committed
#641 code review: fix comment
1 parent a2a1e59 commit 77c85db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/imitation/algorithms/preference_comparisons.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,17 @@ def has_pretraining(self) -> bool:
9595
def unsupervised_pretrain(self, steps: int, **kwargs: Any) -> None:
9696
"""Pre-train an agent before collecting comparisons.
9797
98-
By default, this method asserts that pre-training has zero steps allocated.
9998
Override this behavior in subclasses that implement pre-training.
99+
If not overriden, this method raises ValueError when non-zero steps are
100+
allocated for pre-training.
100101
101102
Args:
102103
steps: number of environment steps to train for.
103104
**kwargs: additional keyword arguments to pass on to
104105
the training procedure.
105106
"""
106107
if steps > 0:
107-
self._logger.warn(
108+
raise ValueError(
108109
f"{steps} timesteps allocated for unsupervised pre-training:"
109110
" Trajectory generators without pre-training implementation should"
110111
" not consume any timesteps (otherwise the total number of"

0 commit comments

Comments
 (0)