mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-07-28 20:11:31 +00:00
reverted generic offpolicy
This commit is contained in:
parent
641a330732
commit
e317ba694f
2 changed files with 3 additions and 5 deletions
|
|
@ -19,10 +19,8 @@ from stable_baselines3.common.noise import ActionNoise
|
|||
from stable_baselines3.common.buffers import ReplayBuffer
|
||||
from stable_baselines3.common.save_util import save_to_pkl, load_from_pkl
|
||||
|
||||
_BufferType = TypeVar("_BufferType", bound=ReplayBuffer)
|
||||
|
||||
|
||||
class OffPolicyAlgorithm(BaseAlgorithm, Generic[_BufferType]):
|
||||
class OffPolicyAlgorithm(BaseAlgorithm):
|
||||
"""
|
||||
The base for Off-Policy algorithms (ex: SAC/TD3)
|
||||
|
||||
|
|
@ -75,7 +73,7 @@ class OffPolicyAlgorithm(BaseAlgorithm, Generic[_BufferType]):
|
|||
env: Union[GymEnv, str],
|
||||
policy_base: Type[BasePolicy],
|
||||
learning_rate: Union[float, Callable],
|
||||
replay_buffer_cls: Type[_BufferType] = None,
|
||||
replay_buffer_cls: Type[ReplayBuffer] = None,
|
||||
replay_buffer_kwargs: Optional[Mapping[str, Any]] = None,
|
||||
buffer_size: int = int(1e6),
|
||||
learning_starts: int = 100,
|
||||
|
|
|
|||
|
|
@ -101,4 +101,4 @@ def test_with_algo(algo):
|
|||
agent.replay_buffer_cls = NstepReplayBuffer
|
||||
agent.replay_buffer_kwargs.update({"gamma":agent.gamma, "n_step": 10})
|
||||
agent._setup_model()
|
||||
agent.learn(500)
|
||||
agent.learn(500)
|
||||
|
|
|
|||
Loading…
Reference in a new issue