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

Feature/take optional kernel_mean_row_sum in refine() #266

Merged
merged 6 commits into from
Dec 6, 2023

Conversation

bk958178
Copy link
Contributor

@bk958178 bk958178 commented Nov 30, 2023

Refs #264

PR Type

  • Feature

Description

Refine.refine() currently calculates kernel_mean_row_sum with no option to use an already-calculated value. This PR adds this as an optional argument to refine(), taking a default value of None to indicate that it still needs to be calculated.

How Has This Been Tested?

No formal testing. Current refine.py unit tests need to be extended to reflect the changes.

Does this PR introduce a breaking change?

No.

Screenshots

(Write your answer here.)

Checklist before requesting a review

  • I have made sure that my PR is not a duplicate.
  • My code follows the style guidelines of this project.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have performed a self-review of my code.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

@bk958178 bk958178 self-assigned this Nov 30, 2023
@bk958178 bk958178 requested a review from tp832944 December 1, 2023 12:02
@bk958178
Copy link
Contributor Author

bk958178 commented Dec 1, 2023

@tp832944 thanks in advance for your review. This unit tests are currently failing, and I believe this is down to circular imports. Unfortunately, I haven't been able to resolve this.

Copy link
Contributor

@tp832944 tp832944 left a comment

Choose a reason for hiding this comment

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

A couple of documentation changes please. Then, copy refine.py into a new pull request.

coreax/refine.py Outdated Show resolved Hide resolved
coreax/refine.py Outdated
:param kernel_mean_row_sum: (Optional) Mean vector over rows for the Gram matrix,
a :math:`1 \times n` array. If this variable has been pre-calculated, pass
it to refine() to reduce computational load. If this variable is passed,
```self.approximate_kernel_row_sum` is ignored.
Copy link
Contributor

Choose a reason for hiding this comment

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

Only one opening quote.

Copy this edit into each of the three concrete classes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I got this one wrong. It should be

:attr:`approximate_kernel_row_sum`

No self.

@bk958178
Copy link
Contributor Author

bk958178 commented Dec 6, 2023

A couple of documentation changes please. Then, copy refine.py into a new pull request.

Thanks @tp832944 . refine.py has been copied to a new pull request: #274

@bk958178 bk958178 requested a review from tp832944 December 6, 2023 14:19
Copy link
Contributor

@tp832944 tp832944 left a comment

Choose a reason for hiding this comment

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

Sorry @bk958178, I got my ReST syntax wrong. So many ways of writing it look nice but just don't work.

coreax/refine.py Outdated Show resolved Hide resolved
coreax/refine.py Outdated Show resolved Hide resolved
coreax/refine.py Outdated Show resolved Hide resolved
@bk958178 bk958178 requested a review from tp832944 December 6, 2023 17:10
Copy link
Contributor

@tp832944 tp832944 left a comment

Choose a reason for hiding this comment

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

Thanks @bk958178. Another step done in OOPing.

@tp832944 tp832944 merged commit c94c004 into feature/oop_106 Dec 6, 2023
0 of 8 checks passed
@tp832944 tp832944 deleted the feature/refine_takes_k_mean_row_sum branch December 6, 2023 17:25
@tp832944 tp832944 linked an issue Dec 6, 2023 that may be closed by this pull request
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.

Take cached kernel_mean_row_sum in Refine
2 participants