Files
NexQuant/rdagent/core/task_generator.py
T

31 lines
892 B
Python
Raw Normal View History

2024-06-14 12:59:44 +08:00
from abc import ABC, abstractmethod
from typing import Generic, List, Sequence, TypeVar
2024-06-14 12:59:44 +08:00
from rdagent.core.experiment import Experiment
ASpecificExp = TypeVar("ASpecificExp", bound=Experiment)
2024-06-14 12:59:44 +08:00
class TaskGenerator(ABC, Generic[ASpecificExp]):
2024-06-14 12:59:44 +08:00
@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.
"""
2024-06-14 12:59:44 +08:00
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
2024-06-14 12:59:44 +08:00
Parameters
----------
feedback_obj_l : List[object]
"""