mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-28 07:57:44 +00:00
f2745c3cc0
* use CoSTEER as component name * rename factorimplementation to avoid confusion * rename modelimplementation * align benchmark and evolving evaluators * add scenario to evaluator init function * rename all factorimplementationknowledge in CoSTEER * remove all scenario related information in component * remove useless code --------- Co-authored-by: xuyang1 <xuyang1@microsoft.com>
35 lines
1019 B
Python
35 lines
1019 B
Python
from abc import ABC, abstractmethod
|
|
from typing import Generic, List, Sequence, TypeVar
|
|
|
|
from rdagent.core.experiment import Experiment
|
|
from rdagent.core.scenario import Scenario
|
|
|
|
ASpecificExp = TypeVar("ASpecificExp", bound=Experiment)
|
|
|
|
|
|
class TaskGenerator(ABC, Generic[ASpecificExp]):
|
|
def __init__(self, scen: Scenario) -> None:
|
|
self.scen: Scenario = scen
|
|
|
|
@abstractmethod
|
|
def generate(self, exp: ASpecificExp) -> ASpecificExp:
|
|
"""
|
|
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.
|
|
|
|
"""
|
|
raise NotImplementedError("generate method is not implemented.")
|
|
|
|
def collect_feedback(self, feedback_obj_l: List[object]):
|
|
"""
|
|
When online evaluation.
|
|
The previous feedbacks will be collected to support advanced factor generator
|
|
|
|
Parameters
|
|
----------
|
|
feedback_obj_l : List[object]
|
|
|
|
"""
|