K-Means: resizes centroids depending on data shape.

Same idea as the whitening functions. This is quite convenient.
Also allowing the callback to break the learning loop.