-
Notifications
You must be signed in to change notification settings - Fork 57
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
1 parent
f86b046
commit f5a189d
Showing
5 changed files
with
133 additions
and
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from tests.test_agents.test_modelbased.test_cem import TestCEM |
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,23 @@ | ||
import shutil | ||
|
||
from genrl.agents import CEM | ||
from genrl.environments import VectorEnv | ||
from genrl.trainers import OnPolicyTrainer | ||
|
||
|
||
class TestCEM: | ||
def test_CEM(self): | ||
env = VectorEnv("CartPole-v0", 1) | ||
algo = CEM( | ||
"mlp", | ||
env, | ||
percentile=70, | ||
policy_layers=[100], | ||
rollout_size=100, | ||
simulations_per_epoch=100, | ||
) | ||
trainer = OnPolicyTrainer( | ||
algo, env, log_mode=["csv"], logdir="./logs", epochs=1 | ||
) | ||
trainer.train() | ||
shutil.rmtree("./logs") |
This file was deleted.
Oops, something went wrong.