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

Circuit simulation widget #2117

Draft
wants to merge 17 commits into
base: dev
Choose a base branch
from
Draft

Circuit simulation widget #2117

wants to merge 17 commits into from

Conversation

clbarnes
Copy link
Contributor

@clbarnes clbarnes commented May 19, 2021

Resurrected Albert's efforts from a few years ago, now as a draft PR to make it easier to find.

This implements Casey's rate models (I believe from https://www.sciencedirect.com/science/article/pii/S0092867416312429 , implemented in https://github.com/ceesem/fb_feedback_model ) in the frontend.

Example units here: https://gist.github.com/clbarnes/7b22409a41f9272c201653937df63d1b

@clbarnes clbarnes force-pushed the feature/circuit-simulation2 branch 2 times, most recently from 113c92a to b79f233 Compare May 24, 2021 13:15
@clbarnes clbarnes force-pushed the feature/circuit-simulation2 branch from b79f233 to e64c503 Compare June 7, 2021 09:38
@clbarnes
Copy link
Contributor Author

clbarnes commented Jun 10, 2021

UI thoughts:

global controls

  • Units are created by adding as single skeletons (uses skeleton names) or as a group (popup asking for group name, pre-populated with e.g. comma-separated names)
    • removal done via the unit dynamics table
  • total time
  • advanced settings collapsed (or tabbed)
    • max iterations per timestep
    • termination criteria? hard to do right
  • Checkbox for "resimulate on change"
    • performance-dependent
    • could automatically cut out at certain complexity level (e.g. n_edges * timesteps * maxit); this could be controlled in advanced settings
  • Button for "normalise weights": ensure that the largest is 1 and scale appropriately
    • Could be a checkbox to do this onchange
  • Button for "populate weights" to get from synapse count
    • checkbox or popup for "normalise by input fraction" (hover: "only for complete skeletons")
    • warning if weights are non-empty
  • buttons for import/ export JSON
  • lock all inputs during execution
  • button to export traces

Tables

All tables collapsible, otherwise the controls are going to be huge. Alternatively, tables could go into content.

  • Unit dynamics table

    • Checkbox for selection: act as skeleton source
    • Each added skeleton/group has a row with columns colourpicker, k, th, I_tonic, scaling, tau
      • additionally, a special top row allowing setting for all selected
    • "Remove unit" button which also clears from weight and stimulation tables
    • Allow renaming? With skeleton names as a hover
    • export as CSV
  • Weight table

    • row and column added for each unit
    • each cell has a num box
    • colour cell background by relative weight?
    • export as CSV
  • Stimulation table:

    • Empty by default with "add row" button for stimulation: drop-down for unit, num boxes for strength, start, stop
    • Same unit can appear multiple times for chains of stimulation
    • Allow sorting by values
    • export as CSV

@clbarnes
Copy link
Contributor Author

Additional features

  • Parameter sweeping
    • UI to run many simulations with small changes to parameters, somehow visualise them
  • "Simulate circuit" button in graph widget (respecting groups etc.)

@clbarnes clbarnes force-pushed the feature/circuit-simulation2 branch 2 times, most recently from cb74be4 to db642bf Compare July 20, 2021 17:00
@clbarnes
Copy link
Contributor Author

Current status

  • fixed a bug which meant the plot's time series was warped
  • simulation units can be uploaded from a JSON file
  • results can be exported as JSON

@clbarnes clbarnes force-pushed the feature/circuit-simulation2 branch 2 times, most recently from ce58325 to c5f3a99 Compare September 3, 2021 12:39
@clbarnes clbarnes force-pushed the feature/circuit-simulation2 branch 3 times, most recently from 27cad8b to df33ba7 Compare December 21, 2021 13:50
clbarnes and others added 11 commits April 12, 2022 11:25
When mouse is passed over a line, if the line has a name, show it in the
title.

Co-authored-by: Albert Cardona <[email protected]>
Co-authored-by: Laura Lungu <[email protected]>
Co-authored-by: Albert Cardona <[email protected]>
Co-authored-by: Laura Lungu <[email protected]>
Integration is defined as a logistic function.
The activity of neurons is plotted as a function of time.

Based completely on Casey Schneider-Mizell's conceptualization and code.

Includes WIP on parameter UI.

Co-authored-by: Albert Cardona <[email protected]>
Co-authored-by: Laura Lungu <[email protected]>
Co-authored-by: Albert Cardona <[email protected]>
Co-authored-by: Laura Lungu <[email protected]>
Prevents the asymptotic nature of logistic functions causing output
where there is no input.

Co-authored-by: Andre Ferreira Castro <[email protected]>
Previously, the time series was assumed to be 0,1,2...,
where the dopri solver actually uses dynamic time steps.
This resulted in a weird-looking graph.
Also allow "Load JSON" to accept results-like JSON.

Minor: set default time to 1000
* use ES6 class syntax
* compose over skel source rather than inherit
* prettify
@clbarnes clbarnes force-pushed the feature/circuit-simulation2 branch from df33ba7 to f0c8863 Compare April 12, 2022 10:25
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.

1 participant