Skip to content

Commit 9412821

Browse files
committed
cleanup: generocity->leniency
as a more fitting English word here
1 parent 33f436b commit 9412821

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

sql/vector_mhnsw.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,14 +1272,14 @@ static int update_second_degree_neighbors(MHNSW_param *p, FVectorNode *node)
12721272
return 0;
12731273
}
12741274

1275-
static inline float generous_furthest(const Queue<Visited> &q, float maxd, float g)
1275+
static inline float lenient_furthest(const Queue<Visited> &q, float maxd, float l)
12761276
{
1277-
float d0=maxd*g/2;
1277+
float d0=maxd*l/2;
12781278
float d= q.top()->distance_to_target;
12791279
float k= 5;
12801280
float x= (d-d0)/d0;
12811281
float sigmoid= k*x/std::sqrt(1+(k*k-1)*x*x); // or any other sigmoid
1282-
return d*(1 + (g - 1)/2 * (1 - sigmoid));
1282+
return d*(1 + (l - 1)/2 * (1 - sigmoid));
12831283
}
12841284

12851285
/*
@@ -1294,7 +1294,7 @@ static int search_layer(MHNSW_param *p, const FVector *target, float threshold,
12941294
Queue<Visited> candidates, best;
12951295
bool skip_deleted;
12961296
uint ef= result_size;
1297-
const float generosity= 1.1f + p->ctx->M/500.0f;
1297+
const float leniency= 1.1f + p->ctx->M/500.0f;
12981298

12991299
if (construction)
13001300
{
@@ -1331,7 +1331,7 @@ static int search_layer(MHNSW_param *p, const FVector *target, float threshold,
13311331
}
13321332

13331333
float furthest_best= best.is_empty() ? FLT_MAX
1334-
: generous_furthest(best, p->acc.diameter, generosity);
1334+
: lenient_furthest(best, p->acc.diameter, leniency);
13351335
while (candidates.elements())
13361336
{
13371337
const Visited &cur= *candidates.pop();
@@ -1364,7 +1364,7 @@ static int search_layer(MHNSW_param *p, const FVector *target, float threshold,
13641364
if (skip_deleted && v->node->deleted)
13651365
continue;
13661366
best.push(v);
1367-
furthest_best= generous_furthest(best, p->acc.diameter, generosity);
1367+
furthest_best= lenient_furthest(best, p->acc.diameter, leniency);
13681368
}
13691369
else
13701370
{
@@ -1381,7 +1381,7 @@ static int search_layer(MHNSW_param *p, const FVector *target, float threshold,
13811381
if (v->distance_to_target < best.top()->distance_to_target)
13821382
{
13831383
best.replace_top(v);
1384-
furthest_best= generous_furthest(best, p->acc.diameter, generosity);
1384+
furthest_best= lenient_furthest(best, p->acc.diameter, leniency);
13851385
}
13861386
}
13871387
}

0 commit comments

Comments
 (0)