75 [[nodiscard]] std::size_t
index(int64_t i, int64_t j)
const;
77 [[nodiscard]]
float at(int64_t i, int64_t j)
const;
Vendor-agnostic compute/memory backend. CPUBackend, CUDABackend (Phase 1.5), and HIPBackend (Phase 1....
Definition device_backend.hpp:248
A set of points in R^dimension, built from activation batches.
Definition point_cloud.hpp:86
N-dimensional tensor. Owns its data buffer exclusively; a DeviceBackend* is injected (not owned) – th...
Definition tensor.hpp:29
Definition acquisition_functions.hpp:16
DistanceMatrix PairwiseDistances(const Tensor &points, const DistanceOptions &options={})
Euclidean distances between every pair of rows.
DistanceMethod
How PairwiseDistances() computes the distances.
Definition distance_matrix.hpp:25
@ Exact
The sum of squared differences, in double on the host. Slower, with an error bound near double precis...
@ Gemm
|x|^2 + |y|^2 - 2 x.y, with the dot products from the backend's float32 GEMM and the rest in double o...
The input to topological data analysis: a layer's activations as a set of points, one row per input o...
The distances between every pair of n points, condensed.
Definition distance_matrix.hpp:56
int64_t size
The number of points, n.
Definition distance_matrix.hpp:58
double error_bound
A bound on the error of every stored distance: |values[k] - exact| <= error_bound for every pair....
Definition distance_matrix.hpp:70
float max_distance
The largest stored distance.
Definition distance_matrix.hpp:72
float at(int64_t i, int64_t j) const
The distance between points i and j; 0 when i == j.
std::size_t index(int64_t i, int64_t j) const
The index in values of the pair (i, j), i != j, in either order.
std::vector< float > values
The n (n - 1) / 2 distances, in pdist order, as float32.
Definition distance_matrix.hpp:60
PairwiseDistances()'s settings.
Definition distance_matrix.hpp:35
DistanceMethod method
How to compute the distances.
Definition distance_matrix.hpp:37
int64_t block_rows
Rows per GEMM block; 0 picks one so a block's output holds at most 2^24 values. The device holds the ...
Definition distance_matrix.hpp:47
bool normalize
Scale every point to unit length (after centering, if centering). Distances are then sqrt(2 - 2 cos),...
Definition distance_matrix.hpp:44
bool center
Subtract the mean point first. It doesn't change Euclidean distances, but it shrinks the norms,...
Definition distance_matrix.hpp:41
N-dimensional tensor – owns a buffer via DeviceBackend*, RAII (Rule of Five).