24 lines
495 B
Python
24 lines
495 B
Python
|
|
"""
|
||
|
|
Algorithm protocol: fixed implementations selected by id from declarative templates.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from typing import Any, Dict, Mapping, Protocol
|
||
|
|
|
||
|
|
from data_layer.training_profile.models import AlgorithmRunResult
|
||
|
|
|
||
|
|
|
||
|
|
class TrainingAlgorithm(Protocol):
|
||
|
|
"""Built-in algorithm callable shape."""
|
||
|
|
|
||
|
|
id: str
|
||
|
|
|
||
|
|
def __call__(
|
||
|
|
self,
|
||
|
|
*,
|
||
|
|
inputs: Mapping[str, Any],
|
||
|
|
params: Mapping[str, Any],
|
||
|
|
) -> AlgorithmRunResult:
|
||
|
|
...
|