Skip to content
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

Update docs and yaml for baselines #292

Merged
merged 1 commit into from
Mar 25, 2024
Merged

Update docs and yaml for baselines #292

merged 1 commit into from
Mar 25, 2024

Conversation

surajpaib
Copy link
Member

@surajpaib surajpaib commented Mar 25, 2024

Description

Related Issue

Type of Change

  • 📚 Examples / docs / tutorials / dependencies update
  • 🔧 Bug fix (non-breaking change which fixes an issue)
  • 🥂 Improvement (non-breaking change which improves an existing feature)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🔐 Security fix

Checklist

  • I've read the CODE_OF_CONDUCT.md document.
  • I've read the CONTRIBUTING.md guide.
  • I've updated the code style using make codestyle.
  • I've written tests for all new methods and classes that I created.
  • I've written the docstring in Google format for all the methods and classes that I used.

Summary by CodeRabbit

  • Documentation
    • Expanded the replication guide with detailed instructions for reproducing study baselines, including configurations for various models.
    • Updated the guide for adapting Fine-Tuned Models for different tasks, with a focus on specific YAML configuration comments.
    • Revised instructions for feature extraction and running predictions with supervised models, including guidance on customizing data paths and parameters.

Copy link

coderabbitai bot commented Mar 25, 2024

Walkthrough

The recent updates enhance the replication guide by providing detailed instructions for reproducing study baselines, adapting fine-tuned models for various tasks, and conducting inference with updated methodologies. These changes aim to streamline the process of model replication, adaptation, and evaluation, making it more accessible and efficient for users by offering clear, step-by-step guidance and emphasizing the use of specific configuration notes and YAML files.

Changes

File Path Change Summary
.../replication-guide/baselines.md Expanded instructions for reproducing baselines with YAML configurations and training commands.
.../replication-guide/fm_adaptation.md Updated adaptation instructions, emphasizing 'Note: comments for task-specific configurations.
.../replication-guide/inference.md Revised feature extraction and prediction instructions, with emphasis on YAML file usage for model testing.

🐇✨
To the world of code, we hop and leap,
With every update, a promise we keep.
Through baselines and models, we guide your way,
In YAML and comments, our wisdom we lay.
🌟 Here's to changes, both big and small,
May they make your coding journey a ball!
🐰💻

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 9

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 3921dcf and ee038a5.
Files ignored due to path filters (14)
  • experiments/baselines/med3d/extract_features.yaml is excluded by: !**/*.yaml
  • experiments/baselines/med3d/finetune.yaml is excluded by: !**/*.yaml
  • experiments/baselines/med3d/supervised_training/get_predictions_task1.yaml is excluded by: !**/*.yaml
  • experiments/baselines/med3d/supervised_training/get_predictions_task2.yaml is excluded by: !**/*.yaml
  • experiments/baselines/med3d/supervised_training/get_predictions_task3.yaml is excluded by: !**/*.yaml
  • experiments/baselines/models_genesis/extract_features.yaml is excluded by: !**/*.yaml
  • experiments/baselines/models_genesis/finetune.yaml is excluded by: !**/*.yaml
  • experiments/baselines/models_genesis/supervised_training/get_predictions_task1.yaml is excluded by: !**/*.yaml
  • experiments/baselines/models_genesis/supervised_training/get_predictions_task2.yaml is excluded by: !**/*.yaml
  • experiments/baselines/models_genesis/supervised_training/get_predictions_task3.yaml is excluded by: !**/*.yaml
  • experiments/baselines/supervised_training/supervised_finetune.yaml is excluded by: !**/*.yaml
  • experiments/baselines/supervised_training/supervised_random_init.yaml is excluded by: !**/*.yaml
  • experiments/inference/extract_features.yaml is excluded by: !**/*.yaml
  • experiments/inference/get_predictions.yaml is excluded by: !**/*.yaml
Files selected for processing (3)
  • docs/replication-guide/baselines.md (1 hunks)
  • docs/replication-guide/fm_adaptation.md (1 hunks)
  • docs/replication-guide/inference.md (2 hunks)
Additional comments: 6
docs/replication-guide/fm_adaptation.md (3)
  • 9-9: The instruction emphasizes searching for 'Note: comments. To improve clarity and consistency, consider specifying the exact nature of these comments more clearly, e.g., by providing an example or explaining what kind of changes these comments will guide the user to make.
  • 7-7: There's a possible spelling mistake detected near line 7. However, upon review, it seems to be a false positive related to the term "init" in "random init baseline," which is a valid term in this context.
  • 6-12: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [27-27]

There's an unpaired symbol near line 27. Ensure that all markdown links are correctly formatted with both opening and closing brackets.

docs/replication-guide/inference.md (1)
  • 13-13: There's an unpaired symbol near line 13. Ensure that all markdown links are correctly formatted with both opening and closing brackets.
docs/replication-guide/baselines.md (2)
  • 7-7: The term "init" in "random init baseline" is correctly used in this context, addressing the static analysis tool's flag as a false positive.
  • 26-26: The term "Med3D / MedicalNet" is correctly spelled, addressing the static analysis tool's flag as a false positive.

Comment on lines 6 to 12

We provide the YAML configuration for this at `experiments/adaptation/fmcib_finetune.yaml`.

By default, we configure this for Task 1. You can adapt this for Task 2 and Task 3 by searching for 'Note: ' comments in the YAML that outline what must be changed. Make sure you download the weights for the pre-trained foundation model before attempting to reproduce this training.
By default, we configure this for Task 1. You can adapt this for Task 2 and Task 3 by searching for `Note: ` comments in the YAML that outline what must be changed. Make sure you download the weights for the pre-trained foundation model before attempting to reproduce this training.


You can start training by running this in the root code folder,
Copy link

Choose a reason for hiding this comment

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

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [18-18]

The term "hyper-parameter" is typically spelled as one word: "hyperparameter." Consider updating this for consistency with common usage in machine learning documentation.

- hyper-parameter optimization framework
+ hyperparameter optimization framework

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [19-19]

The phrase "In order to" can be simplified to "To" for conciseness without losing meaning.

- In order to perform the modelling, you can run
+ To perform the modelling, you can run

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [31-31]

Consider reducing the number of consecutive spaces before "using --scoring roc_auc" for consistency and readability.

- for instance,  using `--scoring roc_auc`
+ for instance, using `--scoring roc_auc`

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [33-33]

The phrase "to try our the modelling process" seems to contain a typo. It should likely be "to try out the modelling process."

- to try our the modelling process
+ to try out the modelling process


## Running predictions from our supervised models (Finetuned FM/ Baselines)
However, this method might be preferred when features need to be extracted from different models (used as baselines in our study). Follow the `Note:` in the corresponding config file to change model paths and use different baselines tested.
Copy link

Choose a reason for hiding this comment

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

To enhance clarity and readability, consider rephrasing "However, this method might be preferred when features need to be extracted from different models" to start with an uppercase letter and simplify the sentence structure.

- However, this method might be preferred when features need to be extracted from different models
+ However, this method is useful for extracting features from various models

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
However, this method might be preferred when features need to be extracted from different models (used as baselines in our study). Follow the `Note:` in the corresponding config file to change model paths and use different baselines tested.
However, this method is useful for extracting features from various models (used as baselines in our study). Follow the `Note:` in the corresponding config file to change model paths and use different baselines tested.


## Running predictions from our supervised models (Finetuned FM/ Baselines)

To run predictions from our models (both supervised and self-supervised), we provide YAML files that can be run with the lighter interface. These are found in `experiments/inference`, namely `get_predictions.yaml` for getting the predictions.

Copy link

Choose a reason for hiding this comment

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

There's a spelling mistake in "Beofre" which should be corrected to "Before."

- Beofre running the predictions config, if you haven't downloaded the `models` folder contraining all our baselines, you can do so using
+ Before running the predictions config, if you haven't downloaded the `models` folder containing all our baselines, you can do so using

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change

Comment on lines 12 to 21
!!! note
While the above pipeline will allow you to extract features, we provide an easier and simpler, recommended API to do this. Please refer to [Quick Start](../getting-started/quick-start.md) or [Cloud Quick Start](../getting-started/cloud-quick-start.md)

However, this method might be preferred when features need to be extracted from different models (used as baselines in our study). Follow the `Note:` in the corresponding config file to change model paths.

## Running predictions from our supervised models (Finetuned FM/ Baselines)
However, this method might be preferred when features need to be extracted from different models (used as baselines in our study). Follow the `Note:` in the corresponding config file to change model paths and use different baselines tested.

## Running predictions from our supervised models (Finetuned FM/ Baselines)

To run predictions from our models (both supervised and self-supervised), we provide YAML files that can be run with the lighter interface. These are found in `experiments/inference`, namely `get_predictions.yaml` for getting the predictions.

Copy link

Choose a reason for hiding this comment

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

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [22-22]

The word "contraining" seems to be a typo. Correct it to "containing."

- contraining all our baselines
+ containing all our baselines

@@ -37,3 +37,5 @@ lighter predict --config_file ./experiments/inference/get_predictions.yaml
```
As with the previous YAMLS, please follow the 'Note:' tags to place appropriate data paths and change relevant parameters. This YAML is to be used if you want to get target predictions from the models.
Copy link

Choose a reason for hiding this comment

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

The term "YAMLS" is not standard and could be confusing. Consider using "YAML files" for clarity.

- As with the previous YAMLS, please follow the 'Note:' tags
+ As with the previous YAML files, please follow the 'Note:' tags

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
As with the previous YAMLS, please follow the 'Note:' tags to place appropriate data paths and change relevant parameters. This YAML is to be used if you want to get target predictions from the models.
As with the previous YAML files, please follow the 'Note:' tags to place appropriate data paths and change relevant parameters. This YAML is to be used if you want to get target predictions from the models.

@@ -1,2 +1,46 @@
# Reproduce Baselines
:hourglass_flowing_sand: Coming soon! :hourglass_flowing_sand:

Reproducing baselines used in this study is very similar to the adaptation of the FM as essentially we are just using the FM weights for adaptation.
Copy link

Choose a reason for hiding this comment

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

Consider adding a comma after "FM" and "essentially" for better readability and to improve the flow of the sentence.

- Reproducing baselines used in this study is very similar to the adaptation of the FM as essentially we are just using the FM weights for adaptation.
+ Reproducing baselines used in this study is very similar to the adaptation of the FM, as essentially, we are just using the FM weights for adaptation.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Reproducing baselines used in this study is very similar to the adaptation of the FM as essentially we are just using the FM weights for adaptation.
Reproducing baselines used in this study is very similar to the adaptation of the FM, as essentially, we are just using the FM weights for adaptation.

@surajpaib surajpaib merged commit b954b62 into master Mar 25, 2024
3 checks passed
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