KMeansModel¶
- class pycave.clustering.kmeans.KMeansModel(config)[source]¶
Bases:
Configurable
[KMeansModelConfig
],Module
PyTorch module for the K-Means model.
The centroids managed by this model are non-trainable parameters.
- Parameters:
config (
KMeansModelConfig
) -- The configuration to use for initializing the module's buffers.
Methods
Computes the distance of each datapoint to each centroid as well as the "inertia", the squared distance of each datapoint to its closest centroid. |
|
Resets the parameters of the KMeans model. |
Inherited Methods
Loads the module's configurations and parameters from files in the specified directory at first. |
|
Saves the module's configuration and parameters to files in the specified directory. |
Attributes
|
The centers of all clusters, buffer of shape |