MCPcopy Create free account

hub / github.com/DeMoriarty/fast_pytorch_kmeans / functions

Functions22 in github.com/DeMoriarty/fast_pytorch_kmeans

↓ 3 callersFunctionfind_optimal_splits
Find an optimal number of split for `n`, such that `get_required_memory(math.ceil(n / n_split))` fits in target device's RAM. get_required_memory
fast_pytorch_kmeans/util.py:50
↓ 3 callersMethodmax_sim
Compute maximum similarity (or minimum distance) of each vector in `a` with all of the vectors in `b` Parameters: a: torc
fast_pytorch_kmeans/multi_kmeans.py:71
↓ 3 callersMethodmax_sim
Compute maximum similarity (or minimum distance) of each vector in `a` with all of the vectors in `b` Parameters: a: to
fast_pytorch_kmeans/kmeans.py:81
↓ 1 callersFunctioncheck_available_ram
Returns available RAM on target device args: device: str or torch.device
fast_pytorch_kmeans/util.py:6
↓ 1 callersMethodfit_predict
Combination of fit() and predict() methods. This is faster than calling fit() and predict() seperately. Parameters: X: to
fast_pytorch_kmeans/multi_kmeans.py:126
↓ 1 callersMethodfit_predict
Combination of fit() and predict() methods. This is faster than calling fit() and predict() seperately. Parameters: X:
fast_pytorch_kmeans/kmeans.py:121
↓ 1 callersFunctionwill_it_fit
Returns True if an array of given byte size fits in target device. if self.safe_mode = False, this function simply compares the given byte size w
fast_pytorch_kmeans/util.py:26
Method__init__
(self, n_clusters, max_iter=100, tol=0.0001, verbose=0, mode="euclidean", init_method='random', minibatch=None
fast_pytorch_kmeans/multi_kmeans.py:34
Method__init__
(self, n_clusters, max_iter=100, tol=0.0001, verbose=0, mode="euclidean", init_method="random", minibatch=None
fast_pytorch_kmeans/kmeans.py:40
Function_kpoints
Pick k points at random in data (one row = one observation). Parameters ---------- data : ndarray Expect a rank 1 or 2 array. Ran
fast_pytorch_kmeans/init_methods.py:101
Function_kpp
Picks k points in the data based on the kmeans++ method. Parameters ---------- data : torch.Tensor Expect a rank 1 or 2 array. R
fast_pytorch_kmeans/init_methods.py:4
Function_krandinit
Returns k samples of a random variable whose parameters depend on data. More precisely, it returns k observations sampled from a Gaussian random
fast_pytorch_kmeans/init_methods.py:50
Methodcos_sim
Compute cosine similarity of 2 sets of vectors Parameters: a: torch.Tensor, shape: [m, n_features] b: torch.Tensor, shape
fast_pytorch_kmeans/multi_kmeans.py:52
Methodcos_sim
Compute cosine similarity of 2 sets of vectors Parameters: a: torch.Tensor, shape: [m, n_features] b: torch.Tensor, s
fast_pytorch_kmeans/kmeans.py:58
Methodeuc_sim
Compute euclidean similarity of 2 sets of vectors Parameters: a: torch.Tensor, shape: [m, n_features] b: torch.Tensor, sh
fast_pytorch_kmeans/multi_kmeans.py:62
Methodeuc_sim
Compute euclidean similarity of 2 sets of vectors Parameters: a: torch.Tensor, shape: [m, n_features] b: torch.Tensor
fast_pytorch_kmeans/kmeans.py:70
Methodfit
Perform kmeans clustering Parameters: X: torch.Tensor, shape: [n_kmeans, n_samples, n_features]
fast_pytorch_kmeans/multi_kmeans.py:204
Methodfit
Perform kmeans clustering Parameters: X: torch.Tensor, shape: [n_samples, n_features]
fast_pytorch_kmeans/kmeans.py:200
Methodget_required_memory
(chunk_size)
fast_pytorch_kmeans/multi_kmeans.py:90
Methodget_required_memory
(chunk_size)
fast_pytorch_kmeans/kmeans.py:102
Methodpredict
Predict the closest cluster each sample in X belongs to Parameters: X: torch.Tensor, shape: [n_kmeans, n_samples, n_features]
fast_pytorch_kmeans/multi_kmeans.py:190
Methodpredict
Predict the closest cluster each sample in X belongs to Parameters: X: torch.Tensor, shape: [n_samples, n_features] R
fast_pytorch_kmeans/kmeans.py:184