LoggerCSV
LoggerCSV
Logger for recording performance metrics in a CSV file.
Attributes:
Name | Type | Description |
---|---|---|
env_type |
EnvType
|
The type of environment. |
llm |
str
|
The language model used. |
csv_file |
str
|
Path to the CSV file for logging. |
logger |
Logger
|
Instance of the logger. |
_initialized |
bool
|
Indicates whether the logger has been initialized. |
__init__(env_type, llm, total_timesteps)
Initialize the LoggerCSV instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
env_type
|
EnvType
|
The type of environment. |
required |
llm
|
str
|
The language model used. |
required |
__new__(env_type, llm, total_timesteps)
Create a new instance of LoggerCSV.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
env_type
|
EnvType
|
The type of environment. |
required |
llm
|
str
|
The language model used. |
required |
Returns:
Name | Type | Description |
---|---|---|
LoggerCSV |
The singleton instance of LoggerCSV. |
to_csv(state)
Write performance metrics to the CSV file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
The state object containing performance metrics. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If the state is not completed. |
getLoggerCSV()
Retrieve the instance of the CSV logger.
Raises:
Type | Description |
---|---|
NotImplementedError
|
If the logger instance has not been created. |