-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
112 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from typing import Optional | ||
|
||
import pytest | ||
|
||
from d3rlpy.algos import TACRConfig | ||
from d3rlpy.types import Shape | ||
|
||
from ...models.torch.model_test import DummyEncoderFactory | ||
from ...testing_utils import create_scaler_tuple | ||
from .algo_test import algo_tester | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"observation_shape", [(100,), (4, 8, 8), ((100,), (200,))] | ||
) | ||
@pytest.mark.parametrize("scalers", [None, "min_max"]) | ||
def test_tacr(observation_shape: Shape, scalers: Optional[str]) -> None: | ||
observation_scaler, action_scaler, reward_scaler = create_scaler_tuple( | ||
scalers, observation_shape | ||
) | ||
config = TACRConfig( | ||
encoder_factory=DummyEncoderFactory(), | ||
critic_encoder_factory=DummyEncoderFactory(), | ||
observation_scaler=observation_scaler, | ||
action_scaler=action_scaler, | ||
reward_scaler=reward_scaler, | ||
) | ||
tacr = config.create() | ||
algo_tester( | ||
tacr, # type: ignore | ||
observation_shape, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters