Skip to content

Commit

Permalink
#641 code review: fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Michelfeit committed Dec 7, 2022
1 parent a2a1e59 commit 77c85db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/imitation/algorithms/preference_comparisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,17 @@ def has_pretraining(self) -> bool:
def unsupervised_pretrain(self, steps: int, **kwargs: Any) -> None:
"""Pre-train an agent before collecting comparisons.
By default, this method asserts that pre-training has zero steps allocated.
Override this behavior in subclasses that implement pre-training.
If not overriden, this method raises ValueError when non-zero steps are
allocated for pre-training.
Args:
steps: number of environment steps to train for.
**kwargs: additional keyword arguments to pass on to
the training procedure.
"""
if steps > 0:
self._logger.warn(
raise ValueError(
f"{steps} timesteps allocated for unsupervised pre-training:"
" Trajectory generators without pre-training implementation should"
" not consume any timesteps (otherwise the total number of"
Expand Down

0 comments on commit 77c85db

Please sign in to comment.