Skip to content

lesser ram ransac - #32

Merged
sappelhoff merged 23 commits into
sappelhoff:masterfrom
yjmantilla:channelWiseRansac
Jul 6, 2020
Merged

sappelhoff merged 23 commits into
sappelhoff:masterfrom
yjmantilla:channelWiseRansac

Conversation

@yjmantilla

@yjmantilla yjmantilla commented Jul 5, 2020 •

Copy link
Copy Markdown
Collaborator

PR Description

Adding a lesser hungry version of the ransac albeit slower since it is done channel by channel. As of now it will try to execute the fast ransac and if that fails will try to do the channel-wise ransac. It is about 5 to 6 times slower than the ram hungry version.

Would close #17 and close #19 also closes #28

Edit: Optimized, now ransac will automatically find the largest chunk of channels it can take at a time without running out of ram.

@codecov-commenter

codecov-commenter commented Jul 5, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #32 into master will increase coverage by 0.42%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
+ Coverage   97.21%   97.64%   +0.42%     
==========================================
  Files           6        6              
  Lines         647      680      +33     
==========================================
+ Hits          629      664      +35     
+ Misses         18       16       -2     
Impacted Files Coverage Δ
pyprep/find_noisy_channels.py 97.24% <100.00%> (+1.26%) ⬆️
pyprep/reference.py 96.33% <100.00%> (+0.03%) ⬆️
pyprep/utils.py 95.23% <100.00%> (+0.50%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 69994f8...cb71e8f. Read the comment docs.

@sappelhoff

Copy link
Copy Markdown
Owner

Cool, thanks @yjmantilla let me know once you are done and I should review

@yjmantilla

yjmantilla commented Jul 5, 2020 •

Copy link
Copy Markdown
Collaborator Author

@sappelhoff should be ready for review now. The basic idea is to do for each channel:

  • predict the channel using a subset of the others channels at certain windows
  • correlate prediction and real data of the channel for each window
  • fill channel_correlation matrix at the channel position for each window

Basically is just exploiting the fact that a column of the channel_correlations matrix depends only on the prediction done for a particular channel, not for all the other channels. So in this sense we predict each channel in different iterations instead of doing all of the predictions at once, thus requiring less ram.

@sappelhoff sappelhoff left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

looks good overall, thanks :)

I left a few comments that need to be addressed before we can merge.

Comment thread docs/whats_new.rst Resolved
Comment thread examples/run_ransac.py Resolved
Comment thread examples/run_ransac.py Resolved
Comment thread pyprep/find_noisy_channels.py Resolved
Comment thread pyprep/find_noisy_channels.py Resolved
Comment thread pyprep/find_noisy_channels.py Resolved

@sappelhoff sappelhoff left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

looks good :) just a few minor comments left.

Comment thread pyprep/utils.py Resolved
Comment thread pyprep/utils.py Resolved
Comment thread pyprep/utils.py Resolved
Comment thread pyprep/find_noisy_channels.py Resolved
Comment thread pyprep/find_noisy_channels.py Resolved
yjmantilla and others added 3 commits July 6, 2020 03:09
@yjmantilla

Copy link
Copy Markdown
Collaborator Author

I'm actually wondering now if it is faster to decrease the chunk size by 1 or to divide it by half. Apparently it is faster to find the largest possible chunk which may be missed when dividing by half.

@sappelhoff

Copy link
Copy Markdown
Owner

I'm actually wondering now if it is faster to decrease the chunk size by 1 or to divide it by half. Apparently it is faster to find the largest possible chunk which may be missed when dividing by half.

you made it work now --> so that's already a nice step. I think there would be other issues to focus on now, instead of optimizing this fix even more :-)

Are you ready with all changes now?

@yjmantilla

yjmantilla commented Jul 6, 2020 •

Copy link
Copy Markdown
Collaborator Author

Almost ready, in the end I couldn't help but implement the optimization of the optimization lol. Also made the output a bit less verbose and straight to the optimal value.

@yjmantilla

Copy link
Copy Markdown
Collaborator Author

ok, it is ready if there are no further suggestions.

@sappelhoff

Copy link
Copy Markdown
Owner

no more suggestions, thanks for the fix!

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.

Unable to finish running PyPREP Slight inconsistency in perform_reference RANSAC consumes too much RAM

3 participants