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

Some additions to generate.py after #1948 #1970

Merged

Conversation

h-mayorquin
Copy link
Collaborator

@h-mayorquin h-mayorquin commented Sep 6, 2023

Some additiosn after #1948.

  • In generate_recording. We say that we will deprecate legacy in the next release but we don't have a deprecation warning. Next release is 0.99, so when this is released it should start throwing a deprecation warning, then we can deprecate it in 0.100. I added the deprecation warning. Plus, if we are going to deprecate we should make lazy the default in main so the code that we start suggestin people to use from main remains valid. Otherwise, they we will need to keep an argument with only one possible value (mode="lazy").
  • I added the type directly in rng.standard_normal as this was generated an expensive computation when I profiled (got 30 % increase in performance for a one hour recorder with "on_the_fly")
  • I also modified the default value for the standard deviation in the NoiseGenerator to 1. I think is a better Schelling Point..
  • I also modified the number of channels in generate_recording_by_size to be the same as SpikeGLX. I remember that at some point it caused me some problems in testing for it to have such an incovenient value (1024) which I think I set because it will play nice with round number of seconds at the beginning but it does not make a lot of sense in retrospective.

@h-mayorquin h-mayorquin self-assigned this Sep 6, 2023
@h-mayorquin h-mayorquin added the core Changes to core module label Sep 6, 2023

pos = 0
for block_index in range(start_block_index, end_block_index + 1):
for block_index in range(first_block_index, last_block_index + 1):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was very strange that this version is faster than my vectorized one. Really surprised about this. That said, I realized that I had a some bad variable names which I have corrected here.

Copy link
Member

Choose a reason for hiding this comment

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

I think we can be even faster in we would use the "out" the rng.standard_normal but the code logic between the 2 modes could not be shared. So lets keep this.
For testing the default mode should be always "tile_pregenerated"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When I profiled it was showing the np.concatenate was the culprit of it being so slow. I will check out on what you say, I remember that I thought about it.

@h-mayorquin
Copy link
Collaborator Author

OK, the error here is not related to this PR as it is already on main in #1971.

@samuelgarcia
Copy link
Member

Merci beaucoup.

Some additiosn after #1948.

  • In generate_recording. We say that we will deprecate legacy in the next release but we don't have a deprecation warning. Next release is 0.99, so when this is released it should start throwing a deprecation warning, then we can deprecate it in 0.100. I added the deprecation warning. Plus, if we are going to deprecate we should make lazy the default in main so the code that we start suggestin people to use from main remains valid. Otherwise, they we will need to keep an argument with only one possible value (mode="lazy").

My plan was to do this in 2 steps first keep "legacy" by default and the switch to lazy. I am ok with lazy now.

  • I added the type directly in rng.standard_normal as this was generated an expensive computation when I profiled (got 30 % increase in performance for a one hour recorder with "on_the_fly")

Of course this avoid one amalooc! Really cool. thank you!

  • I also modified the default value for the standard deviation in the NoiseGenerator to 1. I think is a better Schelling Point..

If we do this. I would like to still have 5 in generate_ground_truth_recording but I think this already the case.

  • I also modified the number of channels in generate_recording_by_size to be the same as SpikeGLX. I remember that at some point it caused me some problems in testing for it to have such an incovenient value (1024) which I think I set because it will play nice with round number of seconds at the beginning but it does not make a lot of sense in retrospective.

Not sure we have to mimic the neuropixel always. sometimes it is good to change number for testing.
But in fact, I do not care so much.

@h-mayorquin
Copy link
Collaborator Author

  • I also modified the default value for the standard deviation in the NoiseGenerator to 1. I think is a better Schelling Point..

If we do this. I would like to still have 5 in generate_ground_truth_recording but I think this already the case.

Great. I think this makes sense.

  • I also modified the number of channels in generate_recording_by_size to be the same as SpikeGLX. I remember that at some point it caused me some problems in testing for it to have such an incovenient value (1024) which I think I set because it will play nice with round number of seconds at the beginning but it does not make a lot of sense in retrospective.

Not sure we have to mimic the neuropixel always. sometimes it is good to change number for testing. But in fact, I do not care so much.

Yeah, I agree with you, it is just a better default than the one I had before which I chosen because of numerology (e.g. 1024 looks nice)!

@alejoe91 alejoe91 merged commit 35a9a1c into SpikeInterface:main Sep 13, 2023
8 checks passed
@h-mayorquin h-mayorquin deleted the change_default_in_generate_recording branch September 13, 2023 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Changes to core module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants