-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable evaluation of EpisodeLog
- Loading branch information
JXZhou
authored and
JXZhou
committed
Jan 2, 2025
1 parent
396db1a
commit 448293f
Showing
4 changed files
with
53 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from abc import ABC, abstractmethod | ||
from .logs import EpisodeLog | ||
|
||
|
||
class BaseEvaluator(ABC): | ||
def __init__(self): | ||
pass | ||
|
||
@abstractmethod | ||
def evaluate(self, epilog: EpisodeLog) -> tuple[float, str]: | ||
""" | ||
evaluate an episode, returns the score and reward prompt | ||
""" | ||
pass | ||
|
||
|
||
class DummyEvaluator(BaseEvaluator): | ||
def __init__(self): | ||
super().__init__() | ||
|
||
def evaluate(self, epilog: EpisodeLog) -> tuple[float, str]: | ||
""" | ||
evaluate an episode, returns the score and reward prompt | ||
""" | ||
return 0.0, "No evaluation implemented" |
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