Skip to content

updated docs of the new clustering models APIs#21

Merged
MechaCritter merged 1 commit into
mainfrom
doc/update-docs-new-api
Jun 13, 2026
Merged

updated docs of the new clustering models APIs#21
MechaCritter merged 1 commit into
mainfrom
doc/update-docs-new-api

Conversation

@MechaCritter

Copy link
Copy Markdown
Owner

Related Issues

Proposed Changes:

This brings the docs in line with the new encoder API. The encoders no longer take pre-fitted kmeans_model / gmm_model objects or lean on the pretrained KMeansWeights / GMMWeights enums as the primary path — they're now configured from parameters (n_clusters / n_components plus kmeans_params / gmm_params / pca_params), trained with learn(), and persisted with save_to_disk / load_from_disk. The old weight-enum path still works but is deprecated, and the docs needed to say so.

The main changes:

  • New docs/clustering/README.md. Documents the pyvisim.clustering package (KMeans, GaussianMixtureModel, PCA) that the encoders now build their vocabulary from — what each model exposes, the diagonal-covariance constraint on the GMM, and the internal _from_sklearn adoption path the legacy weights use.
  • Reworked encoder construction docs. base_encoder.md now describes the params-based constructors and the train/save/load lifecycle instead of the old two-ways-to-supply-a-model story. Added "Constructing one" sections with runnable snippets to vlad.md and fisher_vector.md.
  • Marked the weights path deprecated. weights.md gets a deprecation banner up top and points readers at the learn() + save_to_disk() replacement. Also fixed a couple of now-stale internals (the PCA is loaded by _load_pretrained_weights, not ImageEncoderBase.__init__).
  • Overview updates. overview.md lists the new clustering/ area and replaces the "pretrained weights are enums" bullet with the .encoder persistence story.

I kept the deprecated weights page around rather than deleting it, since the enum path still functions — it just warns now.

How did you test it?

Docs-only change, no code touched. Verified the relative links between the new and edited pages resolve, and that the referenced symbols (save_to_disk, load_from_disk, kmeans_params, gmm_params, pca_params, _from_sklearn, _load_pretrained_weights) match the current pyvisim source.

Notes for the reviewer

Worth a sanity check that the code snippets in vlad.md / fisher_vector.md match the actual constructor signatures, and that I've described the diagonal-covariance constraint and the "don't pass n_clusters / n_components in both places" ValueError behavior correctly.

Checklist

@MechaCritter MechaCritter merged commit 053d2f5 into main Jun 13, 2026
2 of 3 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.

1 participant