forked from NSLS-II/blop
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Thomas Morris
committed
Jan 8, 2024
1 parent
1f45119
commit 24a1886
Showing
5 changed files
with
45 additions
and
23 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,10 @@ | ||
import pytest # noqa F401 | ||
|
||
|
||
def test_agent(agent, RE): | ||
RE(agent.learn("qr", n=4)) | ||
|
||
|
||
def test_forget(agent, RE): | ||
RE(agent.learn("qr", n=4)) | ||
agent.forget(last=2) |
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 |
---|---|---|
@@ -1,20 +1,16 @@ | ||
import pytest # noqa F401 | ||
|
||
|
||
def test_agent(agent, RE): | ||
RE(agent.learn("qr", n=16)) | ||
|
||
|
||
def test_agent_save_load_data(agent, RE): | ||
RE(agent.learn("qr", n=16)) | ||
RE(agent.learn("qr", n=4)) | ||
agent.save_data("/tmp/test_save_data.h5") | ||
agent.reset() | ||
agent.load_data(data_file="/tmp/test_save_data.h5") | ||
RE(agent.learn("qr", n=16)) | ||
RE(agent.learn("qr", n=4)) | ||
|
||
|
||
def test_agent_save_load_hypers(agent, RE): | ||
RE(agent.learn("qr", n=16)) | ||
RE(agent.learn("qr", n=4)) | ||
agent.save_hypers("/tmp/test_save_hypers.h5") | ||
agent.reset() | ||
RE(agent.learn("qr", n=16, hypers_file="/tmp/test_save_hypers.h5")) |