Skip to content

Add native multilayer node-embedding support (state + physical targets) via existing py3plex embedding seams#1342

Merged
SkBlaz merged 9 commits intomasterfrom
copilot/add-production-grade-embedding
Apr 11, 2026
Merged

Add native multilayer node-embedding support (state + physical targets) via existing py3plex embedding seams#1342
SkBlaz merged 9 commits intomasterfrom
copilot/add-production-grade-embedding

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 11, 2026

This PR adds native multilayer embedding support built around py3plex’s (node, layer) state-node model while preserving existing embedding seams and backward compatibility.

What’s included

  • Deterministic state-node indexing and round-trip mapping via NodeLayerIndexer.
  • Shared multilayer embedding foundation (MultiLayerEmbeddingConfig, BaseMultiLayerEmbedding) with:
    • target: state | node | both
    • state→node reduction: mean | sum | max (with guarded attention)
    • interlayer/coupling controls and metadata.
  • New multilayer-capable embedding models integrated into existing APIs:
    • SupraNode2VecEmbedding
    • SupraSpectralEmbedding
    • SupraNetMFEmbedding
    • MNEEmbedding
    • MELLEmbedding
    • MultiLayerGNNEmbedding (explicit experimental scaffold).
  • multi_layer_network.embed(...) dispatch extended for:
    • supra_node2vec, supra_spectral, supra_netmf, mne, mell, multilayer_gnn
    • while preserving existing aliases (multiplex_node2vec, supra_adjacency, layer_regularized).
  • Embedding evaluation utilities extended with edge operators and embedding-native link prediction / richer node classification metrics.

Feedback follow-ups completed

  • Docs were aligned for the new embedding surface:
    • API index now documents additional embedding modules (multiplex, evaluation, similarity).
    • User guide includes a dedicated “Native Multilayer Embedding API” section with usage examples and supported methods.
    • Docs tests were extended to enforce this coverage.
  • Added missing property-based tests for multilayer embedding invariants in:
    • tests/property/test_multilayer_embedding_properties.py
    • covering indexer determinism + round-trip behavior, reducer correctness (mean/sum/max), and guarded attention behavior.

Validation

  • Targeted docs and embedding tests were run successfully, including the new property-based test module and multilayer embedding regression tests.

Copilot AI linked an issue Apr 11, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add production-grade embedding integration to py3plex Add native multilayer node-embedding support (state + physical targets) via existing py3plex embedding seams Apr 11, 2026
Copilot AI requested a review from SkBlaz April 11, 2026 06:30
@SkBlaz
Copy link
Copy Markdown
Owner

SkBlaz commented Apr 11, 2026

@copilot make sure docs are aligned

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 11, 2026

@copilot make sure docs are aligned

Done — docs are now aligned with the new multilayer embedding APIs in both the API index and embedding user guide, and docs tests were updated to enforce this coverage. Addressed in commit 6f202ca (plus the main docs alignment commit 2918feb).

@SkBlaz
Copy link
Copy Markdown
Owner

SkBlaz commented Apr 11, 2026

@copilot you are missing property based tests

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 11, 2026

@copilot you are missing property based tests

Added property-based coverage for the multilayer embedding work in tests/property/test_multilayer_embedding_properties.py (indexer determinism/round-trip, reducer invariants, and guarded attention reducer behavior). Addressed in commit aa5b68c.

@SkBlaz SkBlaz marked this pull request as ready for review April 11, 2026 10:02
@SkBlaz SkBlaz merged commit e6a71e8 into master Apr 11, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sup emb

2 participants