8000 Fix auto-unwrapping in the multiomics example. by wenruifan · Pull Request #472 · pykale/pykale · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix auto-unwrapping in the multiomics example. #472

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 3 commits into
base: main
Choose a base branch
from

Conversation

wenruifan
Copy link
Contributor
@wenruifan wenruifan commented Jun 10, 2025

Fix auto-unwrapping in the multiomics example.

Description

When running the multiomics cancer classification example (MOGONET), setting cfg.DATASET.NUM_MODALITIES=1 leads to an error in line 154:

optimizer[modality].zero_grad()

I also changed the random seed in config.py. The previous seed performs much worse than the reported results in the original paper. New seed performs much closer.

In this case, optimizer is intended to be a list of optimizers; however, the program automatically unwraps the list and returns only an optimizer object if there is only one optimizer in the list. This triggers the error when we use the modality index to fetch an optimizer in the list.

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • In-line docstrings updated.
  • Source for documentation at docs manually updated for new API.

Add a line to prevent auto-unwrapping.
@github-project-automation github-project-automation bot moved this to In progress in PyKale v0.2.0 Jun 10, 2025
@wenruifan wenruifan added the bug Something isn't working label Jun 10, 2025
@wenruifan wenruifan self-assigned this Jun 10, 2025
Copy link
codecov bot commented Jun 10, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.18%. Comparing base (a62ff8d) to head (2cabf2e).

Files with missing lines Patch % Lines
kale/pipeline/multiomics_trainer.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #472      +/-   ##
==========================================
- Coverage   91.19%   91.18%   -0.02%     
==========================================
  Files          67       67              
  Lines        7794     7796       +2     
==========================================
+ Hits         7108     7109       +1     
- Misses        686      687       +1     

☔ 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.

I have updated config.py with a better random seed. Previous seed performs very bad.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

1 participant
0