Skip to content

Conversation

psteinb
Copy link

@psteinb psteinb commented Aug 15, 2025

What does this PR do?

I tried to bring the references in a more homogenous shape and also added them in the class docstrings. This can make it easier for readers to look-up the underlying science to the implementation.

No breaking changes.

Before submitting

  • Did you make sure title is self-explanatory and the description concisely explains the PR?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you test your PR locally with pytest command?
  • Did you run pre-commit hooks with pre-commit run -a command?

All edits were made on github.com

Did you have fun?

yes!

Summary by Sourcery

Enhancements:

  • Uniformly update references in class and method docstrings to include author information and direct arXiv URLs for all cited papers.

Copy link

sourcery-ai bot commented Aug 15, 2025

Reviewer's Guide

Standardized and enriched citation entries in docstrings by appending direct arXiv URLs and unifying the reference style across all methods and class definitions without touching functional code.

Class diagram for updated docstring references in ConditionalFlowMatcher and subclasses

classDiagram
    class ConditionalFlowMatcher {
        +compute_mu_t(x0, x1, t)
        +compute_sigma_t(t)
        +sample_xt(x0, x1, t, epsilon)
        +compute_conditional_flow(x0, x1, t, xt)
        +sample_location_and_conditional_flow(x0, x1, t, return_noise)
        +compute_lambda(t)
        "References updated with arXiv URLs"
    }
    class ExactOptimalTransportConditionalFlowMatcher {
        +sample_location_and_conditional_flow(x0, x1, t, return_noise)
        +guided_sample_location_and_conditional_flow(x0, x1, y0, y1, t, return_noise)
        "References updated with arXiv URLs"
    }
    class TargetConditionalFlowMatcher {
        +compute_mu_t(x0, x1, t)
        +compute_sigma_t(t)
        +compute_conditional_flow(x0, x1, t, xt)
        "References updated with arXiv URLs"
    }
    class SchrodingerBridgeConditionalFlowMatcher {
        +compute_sigma_t(t)
        +compute_conditional_flow(x0, x1, t, xt)
        +sample_location_and_conditional_flow(x0, x1, t, return_noise)
        +guided_sample_location_and_conditional_flow(x0, x1, y0, y1, t, return_noise)
        "References updated with arXiv URLs"
    }
    class VariancePreservingConditionalFlowMatcher {
        +compute_mu_t(x0, x1, t)
        +compute_conditional_flow(x0, x1, t, xt)
        "References updated with arXiv URLs"
    }
    ExactOptimalTransportConditionalFlowMatcher --|> ConditionalFlowMatcher
    TargetConditionalFlowMatcher --|> ConditionalFlowMatcher
    SchrodingerBridgeConditionalFlowMatcher --|> ConditionalFlowMatcher
    VariancePreservingConditionalFlowMatcher --|> ConditionalFlowMatcher
Loading

File-Level Changes

Change Details Files
Standardized citations to include paper URLs across all docstrings
  • Appended arXiv URLs to reference [1] in every method and class docstring
  • Updated reference [2] entries to include its arXiv URL
  • Added URL to reference [3] in VariancePreservingConditionalFlowMatcher
  • Included arXiv link for reference [4] in compute_lambda docstring
torchcfm/conditional_flow_matching.py
Added missing class-level reference entries for homogeneity
  • Inserted citation [1] in the class docstring of ExactOptimalTransportConditionalFlowMatcher
  • Inserted citation [1] in the class docstring of SchrodingerBridgeConditionalFlowMatcher
torchcfm/conditional_flow_matching.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • Consider centralizing repeated reference strings (e.g. URLs and author names) in a single constants module or shared variable to avoid duplication and simplify future updates.
  • Double-check that citation numbering and formatting remain consistent across all classes and methods after adding the URLs to ensure readers aren’t confused by mismatched labels.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider centralizing repeated reference strings (e.g. URLs and author names) in a single constants module or shared variable to avoid duplication and simplify future updates.
- Double-check that citation numbering and formatting remain consistent across all classes and methods after adding the URLs to ensure readers aren’t confused by mismatched labels.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@psteinb
Copy link
Author

psteinb commented Aug 15, 2025

This is just a small contribution to add direct references to the code. One thing, I discovered was that the equation in question here is hard to find in the paper mentioned here.
Would be great if this could be rectified.

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