Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added convenience functions to export embeddings by @Josef-Haupt
- Added some code documentation

### Changed

- Updated flat sigmoid to match birdnet_analyzer by @Josef-Haupt

### Bugfixes

- Fixed issue with one test on Python 3.11 & 3.12
Expand Down
5 changes: 3 additions & 2 deletions src/birdnet/utils/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,10 @@ def fillup_with_silence(


def flat_sigmoid_logaddexp_fast(
x: npt.NDArray, sensitivity: float, clip_val: float = 15.0
x: npt.NDArray, sensitivity: float, clip_val: float = 15.0, bias: float = 1.0

Copilot AI Feb 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new bias parameter lacks test coverage. Consider adding unit tests to verify:

  1. Backward compatibility when bias=1.0 (default)
  2. Correct behavior for various bias values
  3. The transformed_bias calculation matches the BirdNET-Analyzer reference implementation

This is especially important since there are comprehensive tests for other functions in the repository (e.g., in src/birdnet_tests/), and this function is used in the prediction pipeline.

Copilot uses AI. Check for mistakes.
) -> npt.NDArray:
y = sensitivity * np.clip(x, -clip_val, clip_val)
transformed_bias = (bias - 1.0) * 10.0
y = sensitivity * np.clip(x + transformed_bias, -clip_val, clip_val)

positive_mask = y >= 0
abs_y = np.abs(y)
Expand Down
Loading