powered by
Computes the distance matrix in a batched manner to save memory.
compute_batched_distance_matrix( input1, input2, metric = "cosine", batch_size = 10 )
distance matrix
2-D array of query features
2-D array of database features
The distance metric to use. Options include 'euclidean', 'cosine', etc
The number of rows from input1 to process at a time
if (FALSE) { dist_matrix <- compute_batched_distance_matrix(query_embeddings, database_embeddings, metric='cosine', batch_size=12)}
Run the code above in your browser using DataLab