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

[MRG] GUI update init network #853

Merged
merged 15 commits into from
Aug 14, 2024

Conversation

gtdang
Copy link
Collaborator

@gtdang gtdang commented Aug 7, 2024

Update of the _init_network_from_widgets function

Work done:

  • DRYs _init_network_from_widgets by abstracting logic of getting values from drive widgets to _drive_widget_to_dict
  • Filters poisson drive weights and constants for only weights that have positive values. This is because the API add_poisson_drive method can't accept 0 values for rate constants.
  • Updated the init test to look at individual components of the Network because it is still a WIP to get things like tonics and connectivity equivalent between API and GUI. This will be addressed in further work.

@gtdang
Copy link
Collaborator Author

gtdang commented Aug 7, 2024

@ntolley We need to discuss this one.

The work on this PR derived from finding that the number of connections did not match the input file that is loaded into the GUI. We noticed that there were more connections in the GUI-derived network compared to an api network when both used the jones2009_3x3_drives.json input file. It was determined that this is because the GUI is supplying all widget values (even zero-weights) to the drive construction, so connections were created for nulled weights. This PR implements a method to filter and only provide the positive weights (and associated constants) to the drive construction.

This made sense in the context of the jones2009_3x3_drives.json file because it was constructed via the API by supplying only cell types with positive weights. However this does not work for the new default param file jones2009_base.json because this file was derived from the flat default.json file, which had 0 weights for nulled cell-types. With the filtering of this PR in place, the GUI derived network has less connections than the network read in by the API.

So it seems the equivalency is dependent on the how the input file was constructed (supplying the API 0 placeholders or not). I don't think we can rely on a definitive assert net_gui == net_api for these tests. And we need to choose a sensible behavior for the GUI: do we filter for only cell types with positive weights or do we supply all place-holder values?

@gtdang gtdang force-pushed the gui-update-init-network branch from c8a9b3c to b851105 Compare August 8, 2024 23:50
gtdang added 12 commits August 12, 2024 15:59
Filters the poisson widget values for only positive weights and assoicated rate constants. This is because the add_poisson_drive method cannot accept rate constants of 0.
Updated with 0 weights for cells for alpha_prox bursty drive. This will help with GUI tests checking the equivalency of GUI vs api generated networks and.
Testing equvalency between GUI generated network and api generated network required looking at individual attributes of the Networks. Full network comparison will not work because of values that change in the GUI like tstop. Planned work is also going to address some like connectivity and bursty drive differences.
Tonics have a tstop and so it required extra logic to not compare tstop to the api network.
@gtdang gtdang force-pushed the gui-update-init-network branch from d0b4a1c to bca5d84 Compare August 12, 2024 20:49
@gtdang gtdang changed the title [WIP] GUI update init network [MRG] GUI update init network Aug 12, 2024
@gtdang gtdang marked this pull request as ready for review August 12, 2024 21:48
@gtdang gtdang requested a review from ntolley August 12, 2024 21:49
@gtdang
Copy link
Collaborator Author

gtdang commented Aug 14, 2024

@ntolley We need to discuss this one.

The work on this PR derived from finding that the number of connections did not match the input file that is loaded into the GUI. We noticed that there were more connections in the GUI-derived network compared to an api network when both used the jones2009_3x3_drives.json input file. It was determined that this is because the GUI is supplying all widget values (even zero-weights) to the drive construction, so connections were created for nulled weights. This PR implements a method to filter and only provide the positive weights (and associated constants) to the drive construction.

This made sense in the context of the jones2009_3x3_drives.json file because it was constructed via the API by supplying only cell types with positive weights. However this does not work for the new default param file jones2009_base.json because this file was derived from the flat default.json file, which had 0 weights for nulled cell-types. With the filtering of this PR in place, the GUI derived network has less connections than the network read in by the API.

So it seems the equivalency is dependent on the how the input file was constructed (supplying the API 0 placeholders or not). I don't think we can rely on a definitive assert net_gui == net_api for these tests. And we need to choose a sensible behavior for the GUI: do we filter for only cell types with positive weights or do we supply all place-holder values?

Just to document offline discussion.

  • We decided to not filter for 0 weights and add 0 weights to the test input file construction. This is for Evoked and Bursty drives.
  • The poisson drive inputs are still being filtered by positive weights though because the add_poisson_drive api does not take 0 rate constants.

gtdang added 2 commits August 14, 2024 14:31
Updated with 0 weights for cells for poisson drive. This will help with GUI tests checking the equivalency of GUI vs api generated networks and.
This function was needed once we updated the test input file with 0 values. Now poisson is treated the same way as the other drives.
@ntolley ntolley enabled auto-merge (rebase) August 14, 2024 18:36
@ntolley ntolley merged commit a512c5c into jonescompneurolab:master Aug 14, 2024
12 checks passed
@gtdang gtdang deleted the gui-update-init-network branch August 29, 2024 17:34
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.

2 participants