-
MatrixToGraphEmbedder — A family of embedders that map a matrix to a graph.
-
InteractionEmbedder — A matrix to graph embedder using the interaction embedding algorithm.
qoolqit.embedding.matrix_embedder
module
qoolqit.embedding.matrix_embedder
Classes
class
MatrixToGraphEmbedder
(algorithm: Callable, config: ConfigType)
Bases : BaseEmbedder[np.ndarray, DataGraph, ConfigType]
A family of embedders that map a matrix to a graph.
A custom algorithm and configuration can be set at initialization.
Default initializer for all embedders, taking an algorithm and a config.
An algorithm should be a standalone function that takes a piece of data of an InDataType and maps it to an OutDataType. Any extra configuration parameters taken as input by the algorithm function should be defined in the config dataclass, inheriting from EmbeddingConfig.
Parameters
-
algorithm : Callable — a callable to the algorithm function.
-
config : ConfigType — a config dataclass holding parameter values for the algorithm.
Attributes
-
config : ConfigType — Returns the config for the embedding algorithm.
-
algorithm : Callable — Returns the callable to the embedding algorithm.
-
info : str — Prints info about the embedding algorithm.
Methods
method
validate_input
(data: np.ndarray) → None
Raises
-
TypeError
-
ValueError
method
validate_output
(result: DataGraph) → None
Raises
-
TypeError
class
InteractionEmbedder
()
Bases : MatrixToGraphEmbedder[InteractionEmbeddingConfig]
A matrix to graph embedder using the interaction embedding algorithm.
Attributes
-
config : ConfigType — Returns the config for the embedding algorithm.
-
algorithm : Callable — Returns the callable to the embedding algorithm.
-
info : str — Prints info about the embedding algorithm.