From 76a34066bae8df33c5ec10e0c211d6df766adc57 Mon Sep 17 00:00:00 2001 From: LTLA Date: Tue, 15 Oct 2024 08:50:26 -0700 Subject: [PATCH] Don't throw an error if the required number of neighbors is too high. This is none of our business - if the user requests a certain perplexity for a dataset, then we'll respect it and proceed with compute. --- include/qdtsne/initialize.hpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include/qdtsne/initialize.hpp b/include/qdtsne/initialize.hpp index 9b7012e..f06acf7 100644 --- a/include/qdtsne/initialize.hpp +++ b/include/qdtsne/initialize.hpp @@ -108,12 +108,7 @@ Status initialize(NeighborList neighbo */ template Status initialize(const knncolle::Prebuilt& prebuilt, const Options& options) { - const Index_ K = perplexity_to_k(options.perplexity); - Index_ N = prebuilt.num_observations(); - if (K >= N) { - throw std::runtime_error("number of observations should be greater than 3 * perplexity"); - } - + const int K = perplexity_to_k(options.perplexity); auto neighbors = find_nearest_neighbors(prebuilt, K, options.num_threads); return internal::initialize(std::move(neighbors), options.perplexity, options); }