Files
NexQuant/rdagent/core/developer.py
T

35 lines
1.2 KiB
Python
Raw Normal View History

2024-07-18 22:36:04 +08:00
from __future__ import annotations
2024-06-14 12:59:44 +08:00
from abc import ABC, abstractmethod
2024-07-18 22:36:04 +08:00
from typing import TYPE_CHECKING, Generic
2024-06-14 12:59:44 +08:00
from rdagent.core.experiment import ASpecificExp
2024-07-18 22:36:04 +08:00
if TYPE_CHECKING:
from rdagent.core.scenario import Scenario
2024-07-17 15:00:13 +08:00
class Developer(ABC, Generic[ASpecificExp]):
2024-07-05 17:42:00 +08:00
def __init__(self, scen: Scenario) -> None:
self.scen: Scenario = scen
2024-06-14 12:59:44 +08:00
@abstractmethod
def develop(self, exp: ASpecificExp) -> ASpecificExp: # TODO: remove return value
"""
Task Generator should take in an experiment.
Because the schedule of different tasks is crucial for the final performance
due to it affects the learning process.
Current constraints:
- The developer should **inplace** edit the exp instead of returning value;
- because we have a lot of use cases to raise errors, but we need the intermediate results in exp.
- So we should remove the return value in the future.
Responsibilities:
- Generate a new experiment after developing on it.
- If it tries to deliver message for future development, it should set a ExperimentFeedback
"""
2024-07-18 22:36:04 +08:00
error_message = "generate method is not implemented."
raise NotImplementedError(error_message)