Source code for qualia_plugin_som.typing

from __future__ import annotations

import sys
import typing

from qualia_core.typing import ModelConfigDict, ModelParamsConfigDict

if sys.version_info >= (3, 12):
    from typing import TypedDict
else:
    from typing_extensions import TypedDict

[docs] class DSOMLayerParamsConfigDict(TypedDict): learning_rate: float elasticity: float
[docs] class KSOMLayerParamsConfigDict(TypedDict): learning_rate: list[float] neighbourhood_width: list[float]
[docs] class SOMLayerConfigDict(TypedDict): kind: str params: typing.Union[DSOMLayerParamsConfigDict, KSOMLayerParamsConfigDict] # noqa: UP007
[docs] class SOMModelParamsConfigDict(ModelParamsConfigDict): som_layer: SOMLayerConfigDict neurons: list[int] label_sigma: float
[docs] class SOMModelConfigDict(ModelConfigDict): params: SOMModelParamsConfigDict