Skip to content

legacy bug fix for the trainer assuming there exists a model.mode att…#545

Merged
jhnwu3 merged 1 commit intomasterfrom
fix/trainer_mode_check
Sep 12, 2025
Merged

legacy bug fix for the trainer assuming there exists a model.mode att…#545
jhnwu3 merged 1 commit intomasterfrom
fix/trainer_mode_check

Conversation

@jhnwu3
Copy link
Collaborator

@jhnwu3 jhnwu3 commented Sep 12, 2025

This pull request makes minor improvements to the BaseModel class in pyhealth/models/base_model.py to enhance backward compatibility and code readability. The main changes include adding a legacy API attribute and refactoring assertion statements for clarity.

Backward compatibility:

  • Added a mode attribute to the BaseModel class to maintain compatibility with legacy trainer code.

Code readability:

  • Refactored assertion statements in the get_output_size, get_loss_function, and prepare_y_prob methods to use a more readable multi-line format. [1] [2] [3]…ribute when its not really required

@jhnwu3 jhnwu3 merged commit 8b2b769 into master Sep 12, 2025
1 check passed
dalloliogm pushed a commit to dalloliogm/PyHealth that referenced this pull request Nov 26, 2025
…ribute when its not really required (sunlabuiuc#545)

Co-authored-by: John Wu <[email protected]>
@jhnwu3 jhnwu3 deleted the fix/trainer_mode_check branch January 19, 2026 22:51
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.

1 participant