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

Data Driven Spiking Neural Network Optimization in Julia #98

Open
russelljjarvis opened this issue Nov 18, 2021 · 12 comments
Open

Data Driven Spiking Neural Network Optimization in Julia #98

russelljjarvis opened this issue Nov 18, 2021 · 12 comments

Comments

@russelljjarvis
Copy link

russelljjarvis commented Nov 18, 2021

Title

Data-Driven Spiking Neural Network Optimization in Julia

Leaders

Collaborators

Seeking collaborators

Brainhack Global 2021 Event

Brainhack Australasia

Project Description

What are you doing, for whom, and why?

  • The project is for everyone who wants to try to do data fitting of neuron models without Python+external simulation tools. The project is for people who have been frustrated by writing support code in Python for externally supported simulator tools, and who would like to see efficient cellular and network data fitting happening all inside one language.

  • The project intends to consolidate neural electro-physiology tools and support that have existed in Julia for a while by applying tools by example.

What makes your project special and exciting?

It has a basis in Julia-lang which might be novel and exciting for many people, yet, the scope of the project is meta-package, meaning that many of the goals of the project are beginner-friendly.

How to get started?

git clone https://github.com/russelljjarvis/SpikeNetOpt.jl

Data fitting a spiking neural network by exploring the effect of the parameter that controls connectome graph structure:

cd examples
julia sdo_network.jl

Single cell data fitting against spike times:

cd test
julia single_cell_opt_adexp.jl 
julia single_cell_opt_izhi.jl

Where to find key resources?

Link to project repository/sources

https://github.com/russelljjarvis/SpikeNetOpt.jl

Goals for Brainhack Global

  • Refactor optimizer design from bespoke specific examples to a general user interface.
  • Benchmarking of three different Julia Spiking Neural Network backend simulator speeds.
  • eliminate global variables and untyped variables.

Good first issues

  1. Most fun issue: Benchmark execution speed and memory consumption for similar-sized networks on the same network models, for different Julia SNN backends.
    These three approaches need to openly be battled out, against each other for execution speed and memory efficiency.
  1. Make package installable via Project.toml, etc.

  2. Refactor optimizer design from bespoke specific examples to a general user interface.

  3. Make scatter plot animation of optimizer succeeding.

  4. Use existing Python/BluePyOpt code to draw the GA evaluated error surface.

Properly cite this code and borrow from BPO /notebook here:
https://github.com/BlueBrain/BluePyOpt/blob/master/examples/simplecell/simplecell-paperfig.ipynb
Python code Cell 26 draws the error surface.

  1. Convert Python Sciunit relative difference score to Julia relative difference score.

Sciunit scoring has tools, for scaling and normalizing feature measurements, some of these are trivial and some are elaborate.
https://github.com/scidash/sciunit/blob/master/sciunit/scores/complete.py#L247-L329

Implement in Julia sciunits RelativeDifferenceScore, naming convention, and implementation. Note Julia is not Object orientated, so skip over Python's inheritance, if it seems necessary to use a container use Julia struct. It might be helpful to re-implement multiple sciunit scores in Julia, but the most immediately useful one is RelativeDifferenceScore

Communication channels

https://mattermost.brainhack.org/brainhack/channels/spikenetoptjl

Skills

  • git push/pull
  • git commit
  • git PR
  • A desire to learn Julia (but with pre-existing programming knowledge)

Onboarding documentation

I will create a contributing.md in the interim.

What will participants learn?

  • Julia package management of projects.
  • Julia structs
  • Julia multiple dispatch
  • Julia typing

Data to use

At the moment single-cell model fitting occurs on Allen Brain Observatory data (these are cached in JLD files), I have written a Python API included in the Julia code repository (python is called from Julia).

This project would really benefit from experimental multicellular spike train data.

https://observatory.brain-map.org/visualcoding/sdk/index

Number of collaborators

5

Credit to collaborators

I have started using the all contributors tool which makes all contributions to the repository visible (including raising issues via GitHub, or even ideas conveyed outside of GitHub). Also, I can write a reference letter for substantive contribution.

https://github.com/all-contributors/all-contributors

Image

https://user-images.githubusercontent.com/7786645/142357325-60ffea1c-5ef1-4553-a392-7530792cfba0.png

Caption

Why Julia? Python package management is already complicated, reproducible model optimization is made worse by combining Python with external simulators.

Image source: https://xkcd.com/1987/

Type

coding_methods, documentation, method_development, visualization

Development status

1_basic structure

Topic

data_visualisation, neural_networks, reproducible_scientific_methods, single_neuron_models, other

Tools

Python space:
NetworkUnit, NeuronDataWithoutBorders, Neo Analog Signal. (note to be pragmatic, this project still uses some Python)

Julia space:
ClearStacktrace.jl (makes error messages much easier to read)
SignalAnalysis.jl, Evolutionary.jl, SpikingNeuralNetworks.jl, SpikeSynchrony.jl, PyCall.jl

Programming language

Julia, Python.

Modalities

other

Git skills

0_no_git_skills, 1_commit_push, 2_branches_PRs, 3_continuous_integration

Anything else?

Although some Python is used to corroborate/validate optimized models, crucially no Python is used in the optimization loops, as calling Python with PyCall is not fast.

Things to do after the project is submitted.

Twitter sized summary

Julia has enough tools to support fitting spiking neural network models to data. Python speed necessitates external simulators to do network simulation. It would be more developer-friendly to do fast, efficient data fitting of spike trains to network models in one language, let us try to do that here.

@Remi-Gau
Copy link
Member

hey @russelljjarvis

This is looking good already. 😁

Remember to ping us with a @Brainhack-Global/project-monitors when this is ready

@russelljjarvis
Copy link
Author

russelljjarvis commented Nov 18, 2021

Thanks, @Remi-Gau, not sure how much time is left before it is due. I thought I would clean up the base repository a bit, add a contributors file with standard FOSS contribution policies. Put files in predictable places for any newcomers. Then do a Twitter-sized summary of your project pitch.
I suspect this is for a real life event at University of Melbourne, as I am targeting Australasia brain hacks organization.

@Remi-Gau
Copy link
Member

You have quite a bit of time still, no worries!
I don't think that Brainhack Australasia has any deadlines for project submission beyond "before the event starts": though for project review it will be better for us if we don't have to do it in the last 5 minutes before the event starts. 😉

@russelljjarvis
Copy link
Author

Wow thanks for the quick response Remi, Okay, I will try to leave a buffer of 48 hours before :).

@github-actions github-actions bot removed the tools:NWB Neurodata Without Borders label Nov 18, 2021
@russelljjarvis
Copy link
Author

russelljjarvis commented Nov 18, 2021

Hi @Brainhack-Global/project-monitors my project is ready!

@Remi-Gau
Copy link
Member

hey @russelljjarvis
I think that new comers will be happy to have a a bit more info on some of the first issues. Writing "good first issue" can be tricky though, but definitely adding a couple of extra links to external / additional doc or even some pointers to specific functions or line of code in the code base can help people get started faster.

@russelljjarvis
Copy link
Author

@Remi-Gau For sure. My issues are just stubs, and my code doc currently lacks useful entry points. I will fix this soon :)

@russelljjarvis
Copy link
Author

Hi @Remi-Gau, I have added a lot more detail and links to the Github issues today. I have also assigned issue labels, and added a contributing file.

Should I move the more elaborate issues to this brainhacks template or will this bloat it out?

@Remi-Gau
Copy link
Member

No this looks fine as it is on our side: will click the publish button.

I would suggest that any further changes you make should be done on the issues in your repo: as you say we can to keep things leaner in here. 😉

@russelljjarvis
Copy link
Author

russelljjarvis commented Nov 28, 2021

Awesome. Thanks. Will, there be an official link I can use somewhere? Sorry I don't have a good project link.

@Remi-Gau
Copy link
Member

If you mean the link to your project on the BHG2021 website, it is this one: https://brainhack.org/global2021/project/project_98/

Which is pretty much the content of your top comment.

@Remi-Gau Remi-Gau added the bhg:melbourne_aus_1 BHG 2021 Australasia event label Nov 29, 2021
@russelljjarvis
Copy link
Author

russelljjarvis commented Nov 29, 2021

Yes, everything makes sense after today. Thanks for your help. Let me know if you want help with other projects in this process for future brain hack events.

The reason why I was confused as it seemed like Global brainhacks were distinct from Australasia ones. Now I know its all the same thing.

@Remi-Gau Remi-Gau removed their assignment Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment