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

Gridsearch does not support some latency options #338

Open
young-x-skyee opened this issue Jul 26, 2024 · 1 comment
Open

Gridsearch does not support some latency options #338

young-x-skyee opened this issue Jul 26, 2024 · 1 comment
Labels
🪲 bug Something isn't working ❓ discussion needed Extra discussion is needed before work can commence gridsearch Related to the gridsearch

Comments

@young-x-skyee
Copy link
Contributor

young-x-skyee commented Jul 26, 2024

There are two arguments call '--start-latency' (default = -200) and '--emeg-t-start' (default = -200) in run_gridsearch. However, when the -emeg-t-start is larger than --start-latency, the do_gridsearch function will run into error (the 11 is a fake channel number):

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/imaging/projects/cbu/kymata/analyses/tianyi/kymata-core/invokers/run_gridsearch.py", line 327, in <module>
    main()
  File "/imaging/projects/cbu/kymata/analyses/tianyi/kymata-core/invokers/run_gridsearch.py", line 275, in main
    es = do_gridsearch(
         ^^^^^^^^^^^^^^
  File "/imaging/projects/cbu/kymata/analyses/tianyi/kymata-core/kymata/gridsearch/plain.py", line 121, in do_gridsearch
    emeg_reshaped[:, split_i + (j * n_splits), :] = emeg_values[:, j, split_start:split_stop:downsample_rate]
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: could not broadcast input array from shape (11,0) into shape (11,400)

Here '--start-latency' is -200 and '--emeg-t-start' is set to 0

@young-x-skyee young-x-skyee added 🪲 bug Something isn't working gridsearch Related to the gridsearch labels Jul 26, 2024
@young-x-skyee
Copy link
Contributor Author

young-x-skyee commented Jul 26, 2024

Temporary fix in language branch:

    if start_latency - emeg_t_start < 0:
        n_splits -= 1
        split_initial_timesteps = split_initial_timesteps[1:]
        func = func[1:, :]

@young-x-skyee young-x-skyee added the ❓ discussion needed Extra discussion is needed before work can commence label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working ❓ discussion needed Extra discussion is needed before work can commence gridsearch Related to the gridsearch
Projects
None yet
Development

No branches or pull requests

1 participant