Baltor Get started

Library / Code module

Weighted Vendi score

weighted_vendi_score

Measure the effective number of distinct members in a weighted set from a similarity matrix or feature rows. Use it to compare the diversity of samples, prompts, solutions or ensemble members when members carry unequal weight or appear as duplicates.

Files, names only

  • ATTRIBUTION.md 3.9 KB
  • LICENSE 1.0 KB
  • README.md 3.1 KB
  • atom_cli.py 3.0 KB
  • component.json 11.1 KB
  • numerics.py 28.0 KB
  • schema_lite.py 8.9 KB
  • test_package.py 12.0 KB
  • test_weighted_vendi_score.py 5.2 KB
  • weighted_vendi_score.py 4.8 KB

Full files in your harness.

What it takes and gives

Runs with
Python 3.10 or later
Entry points
weighted_vendi_score, vendi_from_features
Known answers
13 cases its tests reproduce

Cases it covers

  • clones not counted as members: An unweighted score counts each clone as a separate member; with conserved weights the two clones are one member.

Limits and scope

Limits
Dense eigendecomposition by Jacobi rotations: intended for at most a few hundred members. Eigenvalues at or below 1e-12 are treated as zero, which matters for orders below 1. The score depends entirely on the chosen kernel; it says nothing about quality, coverage of a target distribution or usefulness of the members.
Guarantees
n mutually orthogonal members with equal weights score n; identical members score 1. Splitting a member into identical clones whose weights sum to its weight leaves the score unchanged. The score lies between 1 and the number of members with positive weight and does not increase with the order q.
Assumes
The similarity matrix is a valid kernel: symmetric, positive semidefinite, with k(x, x) = 1. Weights express how much each row counts; rows with weight 0 do not affect the score.

Details

Kind
Code module
Licence
MIT
Declared effects
runs commands
Source
github.com/alisonjieli-png/loop-engine/tools/creative_originals/evaluation_atoms/items/weighted_vendi_score
Size
10 files, 81.0 KB
Identity
library.supply.creative_originals.2a7d0f8a404ed3a20994566d.7f83db0bc60ccbd6
Version
7f83db0bc60ccbd6f6f7e5fbff6b3893e8bdc7a082fac154044407c947bd0db6

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Where it is shown

Related components

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.