pooling
birdnet_stm32.evaluation.pooling
¶
Score pooling strategies for aggregating chunk-level predictions to file-level.
lme_pooling(scores, beta=10.0)
¶
Log-Mean-Exponential pooling over chunks.
Computes: pooled = log(mean(exp(beta * s_i))) / beta
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scores
|
ndarray
|
[N_chunks, C] chunk scores in [0, 1]. |
required |
beta
|
float
|
Temperature; beta->0 approximates mean, beta->inf approximates max. |
10.0
|
Returns:
| Type | Description |
|---|---|
ndarray
|
[C] pooled scores. |
Source code in birdnet_stm32/evaluation/pooling.py
pool_scores(chunk_scores, method='average', beta=10.0)
¶
Pool chunk-level scores [N, C] to file-level [C].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chunk_scores
|
ndarray
|
Array of shape [N_chunks, C]. |
required |
method
|
str
|
'avg'|'mean'|'average' | 'max' | 'lme' (log-mean-exp). |
'average'
|
beta
|
float
|
Temperature for 'lme' pooling. |
10.0
|
Returns:
| Type | Description |
|---|---|
ndarray
|
[C] pooled scores. |