Skip to content

Add weights and biases support#348

Merged
nictru merged 23 commits intodaisybio:developmentfrom
Orakl-Oncology-Dev:weights-and-biases
Jan 22, 2026
Merged

Add weights and biases support#348
nictru merged 23 commits intodaisybio:developmentfrom
Orakl-Oncology-Dev:weights-and-biases

Conversation

@nictru
Copy link
Collaborator

@nictru nictru commented Jan 14, 2026

This adds a first draft of what native weights and biases support could look like. Targets #6. Let's discuss if you guys like it so far or if it should be done differently.

Not sure if this can be tested properly, as it requires logging in to wandb in some way.

New feature

  • Weights and biases support; added to DrugGNN, MOLIR, PharmaFormer, SimpleNeuralNetwork, MultiOmicsNeuralNetwork, SuperFELTR -> new parameter --wandb_project

@nictru
Copy link
Collaborator Author

nictru commented Jan 14, 2026

I can't comprehend why isort is throwing an error here, I tried changing the import order in the faulty file several times and it always corrects it to the version that is in this PR

@JudithBernett JudithBernett linked an issue Jan 14, 2026 that may be closed by this pull request
@JudithBernett
Copy link
Contributor

About the testing: I'd say it's okay if this functionality is not tested then. It is a nice add-on feature, but it does not change the functionality of the framework.

@nictru
Copy link
Collaborator Author

nictru commented Jan 15, 2026

Why is it working now 🤯

@nictru
Copy link
Collaborator Author

nictru commented Jan 15, 2026

So adding/removing the diff arg from isort seems to toggle if it errors or not

@nictru
Copy link
Collaborator Author

nictru commented Jan 15, 2026

The first time I encountered a Heisenbug in real life (Wikipedia):

In computer programming jargon, a heisenbug is a software bug that seems to disappear or alter its behavior when one attempts to study it.

@nictru
Copy link
Collaborator Author

nictru commented Jan 15, 2026

Okay now we can see:

 from typing import Any
 
 import numpy as np
+import wandb
 import yaml
 from sklearn.model_selection import ParameterGrid
-
-import wandb

So @JudithBernett was right, but still the local pre-commit always wants to change it to the current version

@nictru
Copy link
Collaborator Author

nictru commented Jan 15, 2026

So it seems to work now, unfortunately my local pre-commit isort still does not match the remote CI behavior, which makes the entire pre-commit process a bit annoying

@nictru nictru marked this pull request as ready for review January 15, 2026 09:40
@codecov-commenter
Copy link

codecov-commenter commented Jan 15, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 50.00000% with 107 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (development@f3afe32). Learn more about missing BASE report.

Files with missing lines Patch % Lines
drevalpy/models/drp_model.py 38.80% 41 Missing ⚠️
drevalpy/experiment.py 18.60% 35 Missing ⚠️
drevalpy/models/lightning_metrics_mixin.py 69.69% 10 Missing ⚠️
drevalpy/models/MOLIR/utils.py 36.36% 7 Missing ⚠️
drevalpy/models/SuperFELTR/utils.py 30.00% 7 Missing ⚠️
drevalpy/models/DrugGNN/drug_gnn.py 72.72% 3 Missing ⚠️
drevalpy/models/PharmaFormer/pharmaformer.py 92.00% 2 Missing ⚠️
drevalpy/models/SimpleNeuralNetwork/utils.py 77.77% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@              Coverage Diff               @@
##             development     #348   +/-   ##
==============================================
  Coverage               ?   81.63%           
==============================================
  Files                  ?       67           
  Lines                  ?     7138           
  Branches               ?        0           
==============================================
  Hits                   ?     5827           
  Misses                 ?     1311           
  Partials               ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JudithBernett
Copy link
Contributor

So it seems to work now, unfortunately my local pre-commit isort still does not match the remote CI behavior, which makes the entire pre-commit process a bit annoying

hm maybe it's the version? I have 4.5.1; the latest one

@nictru
Copy link
Collaborator Author

nictru commented Jan 15, 2026

It's more about the isort version, I tried both 7.0.0 (latest) and 6.0.1 (used in the CI)

@PascalIversen
Copy link
Collaborator

image Works great for me, very cool to have this! In the long run, we could make the logging better for our models with more metrics etc.

Implementation-wise, I also think it's great (apart from that it's missing from the command line interface :) )

@nictru nictru force-pushed the weights-and-biases branch from 434c5cf to 30af514 Compare January 18, 2026 21:27
@nictru
Copy link
Collaborator Author

nictru commented Jan 20, 2026

I played around with wandb a bit more, tested the implementation both with hyperparameter tuning on and off to ensure the logged metrics always make sense

@JudithBernett JudithBernett self-requested a review January 22, 2026 13:54
Copy link
Contributor

@JudithBernett JudithBernett left a comment

Choose a reason for hiding this comment

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

looks great to me!! approved

@nictru nictru merged commit 4ed1602 into daisybio:development Jan 22, 2026
24 of 29 checks passed
@nictru nictru deleted the weights-and-biases branch January 22, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Weights and Biases Integration

4 participants