tfmot.clustering.keras.CentroidInitialization

Specifies how the cluster centroids should be initialized.

  • LINEAR: Cluster centroids are evenly spaced between the minimum and maximum values of a given weight tensor.
  • RANDOM: Centroids are sampled using the uniform distribution between the minimum and maximum weight values in a given layer.
  • DENSITY_BASED: Density-based sampling obtained as follows: first a cumulative distribution function is built for the weights, then the Y axis is evenly spaced into as many regions as many clusters we want to have. After this the corresponding X values are obtained and used to initialize the clusters centroids.
  • KMEANS_PLUS_PLUS: cluster centroids using the kmeans++ algorithm

DENSITY_BASED <CentroidInitialization.DENSITY_BASED: 'CentroidInitialization.DENSITY_BASED'>
KMEANS_PLUS_PLUS <CentroidInitialization.KMEANS_PLUS_PLUS: 'CentroidInitialization.KMEANS_PLUS_PLUS'>
LINEAR <CentroidInitialization.LINEAR: 'CentroidInitialization.LINEAR'>
RANDOM <CentroidInitialization.RANDOM: 'CentroidInitialization.RANDOM'>