-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlgorithmConfig.h
More file actions
58 lines (44 loc) · 1.26 KB
/
Copy pathAlgorithmConfig.h
File metadata and controls
58 lines (44 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef ALGORITHM_CONFIG_H
#define ALGORITHM_CONFIG_H
#include <cstddef>
#include <cstdint>
#include <string>
struct SearchConfig {
std::size_t result_count{10};
float gamma{0.185f};
std::size_t entry_point_count{100};
};
struct QuantizationConfig {
std::size_t centroid_count{64};
std::size_t total_bits{9};
std::size_t navigation_bits{4};
};
struct GraphConfig {
std::size_t graph_degree{96};
std::uint32_t random_seed{114514};
std::size_t ef_construction{400};
std::size_t onng_max_outdegree{96};
std::size_t onng_max_indegree{144};
std::size_t onng_min_edges{64};
std::size_t vamana_refinement_degree{72};
float vamana_refinement_alpha{1.2f};
std::size_t cache_affinity_window{32};
std::size_t build_thread_limit{32};
};
struct AlgorithmConfig {
SearchConfig search;
QuantizationConfig quantization;
GraphConfig graph;
};
namespace algorithmconfig {
AlgorithmConfig defaults();
bool validate(
const AlgorithmConfig& config,
std::string* error = nullptr);
bool load(
const std::string& path,
AlgorithmConfig& config,
std::string* error = nullptr);
std::string defaultPathForExecutable(const char* executable_path);
} // namespace algorithmconfig
#endif // ALGORITHM_CONFIG_H