Skip to content

426 add bnn #515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

426 add bnn #515

wants to merge 14 commits into from

Conversation

msmiyels
Copy link
Collaborator

@msmiyels msmiyels commented Jun 20, 2025

BNN
Object oriented implementation of the bayesian neural network for binary classification.

Designed for additional cases:

  • Multiclass could be added
  • Regression could be added

⚠️ Needed to modify the environment setup:

  • Local Conda installation
  • Docker Poetry installation

Each way needed changes in order to get even the environment running. Also added tensorflow-probability.

Works basically as other ML methods from sklearn using the model.fit() approach.

Done before PR:

  • Pytest
  • Docs
  • Pre-Commit
  • Added notebook for basic experiments (own data must be provided)

LICENSING
Added THRID-PARTY-LICENCSES since some of the core capabilities rely on MIT licensing.

@nmaarnio is it possible to put the bayesian_neural_network.py under MIT license? It's not mandatory but may simplify the re-use of this particular code in other applications/repos.

OTHERS

  • "Quick-fixed" the _extract_values_from_raster function since Windows and Linux handle file paths differently. The former code used rsplit("/", 1) explicitly, which resulted in wrong column names on Windows.

msmiyels and others added 4 commits May 16, 2025 15:33
- Modified Dockerfile
   - Did not install properly
   - Added git
@msmiyels msmiyels linked an issue Jun 20, 2025 that may be closed by this pull request
@msmiyels msmiyels self-assigned this Jun 20, 2025
@msmiyels msmiyels requested a review from nmaarnio June 20, 2025 15:30
@msmiyels msmiyels added the enhancement New feature or request label Jun 23, 2025
msmiyels added 3 commits June 23, 2025 08:45
------
- Added numpy specifically to the environment setup
- "Quick-fixed" the _extract_values_from_raster function due to an error in testing (column name). There is a different path handling for Windows and Linux based OS, ("\" vs. "/"), which caused using the file path instead of the file name. `basename` resolves this issue.
- Removed one test that's already covered with `beartype`, however, which only raised up in Windows, not in Linux.

Enhancements:
-------------
- Added BNN early stopping minimum delta
- Added a test for this parameter
@msmiyels msmiyels added modification Change to an existing feature modelling Features related to modelling functions labels Jun 23, 2025
msmiyels added 5 commits June 24, 2025 15:03
- Added support for setting prior_std
- Modified prior_std for more robust uncertainty computing
- Added probability comparison for BNN tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request modelling Features related to modelling functions modification Change to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add BNN
1 participant