Skip to content

Commit

Permalink
Fix mypy check
Browse files Browse the repository at this point in the history
  • Loading branch information
takuseno committed Feb 12, 2025
1 parent 124d456 commit 3f9a2aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions reproductions/offline/qdt.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import d3rlpy
from d3rlpy.algos import CQL, IQL
from d3rlpy.algos.qlearning.torch.iql_impl import IQLModules
from d3rlpy.dataset import InfiniteBuffer, ReplayBuffer
from d3rlpy.types import NDArray

Expand Down Expand Up @@ -232,9 +233,10 @@ def fit_iql(
# workaround for learning scheduler
iql.build_with_dataset(dataset)
assert iql.impl
assert isinstance(iql.impl.modules, IQLModules)
scheduler = CosineAnnealingLR(
iql.impl._modules.actor_optim, # pylint: disable=protected-access
500000,
optimizer=iql.impl.modules.actor_optim.optim,
T_max=500000,
)

def callback(algo: d3rlpy.algos.IQL, epoch: int, total_step: int) -> None:
Expand Down

0 comments on commit 3f9a2aa

Please sign in to comment.