-
Notifications
You must be signed in to change notification settings - Fork 1
Code Refinement: Quality Enhancements and Strategic TODOs #7
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
ntomita
wants to merge
8
commits into
master
Choose a base branch
from
bugfix/package-config-edgecases
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
34b32d5
Improve code quality, suggest improvements, and handle edge cases
ntomita 6544f5b
Merge: Improve code quality, suggest improvements, and handle edge cases
ntomita bcc1228
Merge: packaging refactoring
ntomita 31fb468
Add: init files for packaging
ntomita 96d4c60
Fix: apply missing config values
ntomita df3cbbd
Merge: add TODOs and regression case
ntomita 955610d
Fix: change default checkpoint dir name
ntomita 553df41
Cleanup: Removed debug messages and clarified TODO comments
ntomita File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| # Dataset and Model Configuration File | ||
| # This configuration file sets parameters for dataset preprocessing and model training. | ||
| # Modify values in config_user.yaml to override defaults. | ||
|
|
||
| # NOTE: To override any values in this file, please create config_user.yaml | ||
| # (or any YAML file name of you like). | ||
| # In config_user.yaml, only define the variables you wish to update. | ||
| # Unmentioned variables will use the default values specified here. | ||
| # Please avoid directly modifying values in this file. | ||
| # | ||
| # Documentation Tags: | ||
| # (default): variables can be left with their default values | ||
| # (custom): more likely to need modification for each user | ||
| #--------------------------------------------------- | ||
|
|
||
| ### DATASET CONFIGURATION ### | ||
| dataset: | ||
| ## Dataset configuration | ||
|
|
||
| # Path to the file (svs_meta.pickle) containing meta info about svs data | ||
| # File is generated by SlidePrep/MaskHIT_Prep/05_post_process.py | ||
| meta_svs: !!str <SET_YOUR_OWN_VALUE> | ||
|
|
||
| # Path to the file (meta.pickle) containing meta info about the dataset | ||
| # File is generated by SlidePrep/MaskHIT_Prep/01_get_svs_meta.py | ||
| meta_all: !!str <SET_YOUR_OWN_VALUE> | ||
|
|
||
| # Outcome our model is trying to predict | ||
| # Example: "Dx (U=UC, C=Cr, I=Ind)" | ||
| #TODO: Not sure what this is meant. In what format? If this is for classification, clarify. | ||
| outcome: !!str <SET_YOUR_OWN_VALUE> | ||
|
|
||
| # classification type | ||
| # Available options: survival, classification, regression | ||
| outcome_type: !!str classification | ||
|
|
||
| # the name of the study | ||
| #TODO: suggest to rename to 'study_name' for clarity. | ||
| study: !!str <SET_YOUR_OWN_VALUE> | ||
|
|
||
| # type of disease; whether it is cancer or not | ||
| #TODO: Add doc to discuss why this is matter. If necessary, we should rename. | ||
| is_cancer: !!bool False | ||
|
|
||
| # title of project/disease name | ||
| #TODO: what's the difference between this and 'study' | ||
| #This seems to be used for folder value:?? | ||
| # `meta_svs['folder'] = config.dataset.disease` | ||
| #Better rename or explain the main intent of this parameter. | ||
| disease: !!str <SET_YOUR_OWN_VALUE> | ||
|
|
||
| # names of classes in your dataset | ||
| #TODO: need doc and example. | ||
| classes: !!str <SET_YOUR_OWN_VALUE> | ||
|
|
||
| # Number of folds for nested cross-validation | ||
| num_folds: !!int 5 | ||
|
|
||
| patch: | ||
| ## Patch configuration | ||
|
|
||
| # number of patches from each region. If 0 will sample all patches | ||
| num_patches: !!int 0 | ||
|
|
||
| # magnification level at which patches were extracted at | ||
| #TODO: Why manually setting this again? Or can we specify a config file from Prep to extract this info? | ||
| magnification: !!int 10 | ||
|
|
||
| # intensity of weight decay | ||
| #TODO: Why this is under patch section? | ||
| wd: !!float 0.01 | ||
|
|
||
| model: | ||
| ## Model configuration | ||
|
|
||
| # used for uneven class distribution | ||
| weighted_loss: !!bool False | ||
|
|
||
| # learning rate | ||
| lr: !!float 1e-5 | ||
|
|
||
| # Dropout rate | ||
| dropout: !!float 0.2 | ||
|
|
||
| # Batch size for processing slide patches | ||
| batch_size: !!int 16 | ||
|
|
||
| # which fold to use after kfold cross validation | ||
| #TODO: Not sure what this means. Also suggest to change variable name to be more descriptive. | ||
| fold: !!int 0 | ||
|
|
||
| # determines whether old logs should stay | ||
| override_logs: !!bool True | ||
|
|
||
| # number of svs sampled in sample-patient mode | ||
| regions_per_svs: !!int 64 | ||
|
|
||
| #TODO: Copied from config_ibd_train.yaml. Need to double check the default values. | ||
| # Weight Decays | ||
| wd_attn: !!float 1e-3 | ||
| wd_fuse: !!float 1e-2 # changed from 1e-3 to 1e-2 | ||
| wd_loss: !!float 1e-2 # changed from 1e-3 to 1e-2 | ||
| wd_pred: !!float 0.002 | ||
|
|
||
| #TODO: Copied from config_ibd_train.yaml. Need to double check the default values. | ||
| # Learning Rates | ||
| lr_attn: !!float 1e-5 # lowered since we are using pre-trained model | ||
| lr_fuse: !!float 1e-4 | ||
| lr_loss: !!float 1e-4 | ||
| lr_pred: !!float 7e-4 | ||
|
|
||
| #TODO: Copied from config_ibd_train.yaml. Need to double check the default values. | ||
| #Not sure what this is for, as in the code it chooses a measure based on outcome_type? | ||
| performance_measure: !!str f1 | ||
|
|
||
| #TODO: Copied from config_ibd_train.yaml. Add doc. | ||
| accumulation_steps: !!int 1 | ||
|
|
||
| #TODO: Copied from config_ibd_train.yaml. Need to double check the default values. | ||
| dropout: !!float 0.2 | ||
|
|
||
| #TODO: Copied from config_ibd_train.yaml. Need to double check the default values. | ||
| #TODO: What is this for? and what's # for visualization (64) | ||
| batch_size: !!int 16 # for visualization (64) | ||
|
|
||
| #TODO: Copied from config_ibd_train.yaml. Maybe: overwrite_logs | ||
| override_logs: !!bool True | ||
|
|
||
| # TBD | ||
| #TODO: Missing docs. | ||
| sample_patient: !!bool True | ||
|
|
||
| # Check-point path? | ||
| #TODO: Missing docs. | ||
| resume: null | ||
|
|
||
|
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We renamed the checkpoints to avoid the confusion.
One type were generated from pre-trained and other were generated from fine tuned