Skip to content

[codex] Fix LINE edge sampling probabilities#84

Draft
shenweichen wants to merge 1 commit intomasterfrom
codex/fix-line-sampling
Draft

[codex] Fix LINE edge sampling probabilities#84
shenweichen wants to merge 1 commit intomasterfrom
codex/fix-line-sampling

Conversation

@shenweichen
Copy link
Copy Markdown
Owner

Summary

  • Normalize LINE edge sampling probabilities before passing them to the alias table.
  • Add a regression test that verifies both node and edge sampling tables receive probability distributions summing to 1.

Root cause

create_alias_table expects normalized probabilities and scales them internally by table length. LINE edge sampling already multiplied each edge weight by numEdges, so the alias input summed to the number of edges instead of 1.

Addresses #31 and #51. This may also help investigate the LINE NaN reports in #33 and #73.

Checks

  • git diff --check
  • python -m pytest tests/line_test.py
  • python -m pytest tests/examples_test.py -k line

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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.

1 participant