qbiocode.apps.quvine.api.core module#
Public embedding-extraction API for QuVINE.
from qbiocode.apps.quvine import embed result = embed(graph, “quvine_rwr”) # SGNS walk embedding result = embed(graph, “gat_ctqw_heat”, seeds=s) # one registry method Z = result.embedding # (n_nodes, dim) ndarray
embed returns an EmbedResult carrying the matrix, the node order
its rows align to, and metadata about what was actually run.
Summary#
Exceptions:
Raised when a requested method cannot be run or fails during execution. |
Classes:
Result of |
Functions:
Extract a single QuVINE embedding from |
__all__: EmbedResult, QuvineMethodError, embed, list_methods, load_config
Reference#
- embed(graph, method, config=None, *, seeds=None, base_seed=None, fuse=False, fuse_method=None, overrides=None, n_jobs=1, chunk_size=30, verbose=False)[source]#
Extract a single QuVINE embedding from
graphusingmethod.- Parameters:
graph (
Graph) – NetworkX graph to embed.method (
str) – Method name. SGNS walks ("quvine_rwr","ctqw", …), a registry method ("node2vec","gat_ctqw_heat","quvine_graphgps_dtqw_poly", …), or a fused name ("quvine_fused"). Seequvine.api.list_methods().config (
Union[DictConfig,dict,str,None]) – OmegaConf/dict/path or None for the packaged default schema.seeds (
Optional[Sequence]) – Seed nodes used to build quantum targets for quantum-calibrated registry methods (gat_*/graphgps_*/filter_*/quvine_* GCN-MF).base_seed (
Optional[int]) – Overridecfg.experiment.base_seed.fuse (
bool) – If True, run allcfg.walks.kindsSGNS embeddings and fuse them (equivalent to passing a fused method name).fuse_method (
Optional[str]) – Fusion strategy; defaults tocfg.fusion.method.overrides (
Union[dict,list,DictConfig,None]) – Deep-merged ontoconfig(dict / DictConfig / dotlist).n_jobs (
int) – joblib parallelism for the SGNS walk loop.chunk_size (
int) – joblib parallelism for the SGNS walk loop.verbose (
bool) – Verbose logging for registry execution.
- Return type:
- Returns:
An
EmbedResult.- Raises:
QuvineMethodError – unknown method, missing quantum targets, or a failed registry executor.
- class EmbedResult(embedding, node_order, method, requested_method, kind, dim, execution_time=0.0, used_quantum_targets=False, extra=<factory>)[source]#
Bases:
objectResult of
embed().-
embedding:
ndarray#
-
node_order:
list#
-
method:
str#
-
requested_method:
str#
-
kind:
str#
-
dim:
int#
-
execution_time:
float= 0.0#
-
used_quantum_targets:
bool= False#
-
extra:
Dict[str,Any]#
-
embedding: