mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-01 09:27:43 +00:00
@@ -0,0 +1,31 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import List
|
||||
|
||||
from factor_implementation.share_modules.factor import (
|
||||
FactorImplementation,
|
||||
FactorImplementationTask,
|
||||
)
|
||||
|
||||
|
||||
class FactorGenerator(ABC):
|
||||
"""
|
||||
Because implementing factors will help each other in the process of implementation, we use the interface `List[FactorImplementationTask] -> List[FactorImplementation]` instead of single factor .
|
||||
"""
|
||||
|
||||
def __init__(self, target_task_l: List[FactorImplementationTask]) -> None:
|
||||
self.target_task_l = target_task_l
|
||||
|
||||
@abstractmethod
|
||||
def generate(self, *args, **kwargs) -> List[FactorImplementation]:
|
||||
raise NotImplementedError("generate method is not implemented.")
|
||||
|
||||
def collect_feedback(self, feedback_obj_l: List[object]):
|
||||
"""
|
||||
When online evaluation.
|
||||
The preivous feedbacks will be collected to support advanced factor generator
|
||||
|
||||
Parameters
|
||||
----------
|
||||
feedback_obj_l : List[object]
|
||||
|
||||
"""
|
||||
Reference in New Issue
Block a user