MCPcopy
hub / github.com/DLR-RM/stable-baselines3 / test_train_freq

Function test_train_freq

tests/test_run.py:118–134  ·  view source on GitHub ↗
(tmp_path, train_freq)

Source from the content-addressed store, hash-verified

116
117@pytest.mark.parametrize("train_freq", [4, (4, "step"), (1, "episode")])
118def test_train_freq(tmp_path, train_freq):
119 model = SAC(
120 "MlpPolicy",
121 "Pendulum-v1",
122 policy_kwargs=dict(net_arch=[64, 64], n_critics=1),
123 learning_starts=100,
124 buffer_size=10000,
125 verbose=1,
126 train_freq=train_freq,
127 )
128 model.learn(total_timesteps=150)
129 model.save(tmp_path / "test_save.zip")
130 env = model.get_env()
131 model = SAC.load(tmp_path / "test_save.zip", env=env)
132 model.learn(total_timesteps=150)
133 model = SAC.load(tmp_path / "test_save.zip", train_freq=train_freq, env=env)
134 model.learn(total_timesteps=150)
135
136
137@pytest.mark.parametrize("train_freq", ["4", ("1", "episode"), "non_sense", (1, "close")])

Callers

nothing calls this directly

Calls 5

learnMethod · 0.95
SACClass · 0.90
get_envMethod · 0.80
saveMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…