GSoC 2024 Project Idea 18.2 Improve Brian’s markdown exporter (175 h)

Brian is a clock-driven spiking neural network simulator which is easy to learn and use, highly flexible and easy to extend. It is written in Python and allows describing and running arbitrary neural and synaptic models without having to write code in any other programming language. It is built on a code-generation framework that transforms the model description into efficient low-level code. While this code generation is commonly used to generate code to run a simulation, it can also be used to generate a description of a simulation. This approach is implemented in the Markdown exporter that is part of the brian2tools package (https://brian2tools.readthedocs.io). The aim of this project is to extend this exporter in the following ways:

  • add easy customization of the output via templates (including the necessary code reorganisation and refactoring)
  • integrate with pandoc to transform the markdown output into other formats such as LaTeX or HTML
  • add support for Brian’s multi-compartment neuron models

Skill level: Novice/Intermediate

Required skills: Markdown, Python

Time commitment: Medium (175 h)

Lead mentor: Ben Evans (B.D.Evans@sussex.ac.uk)

Project website: https://github.com/brian-team/brian2tools

Backup mentors: Marcel Stimberg (marcel.stimberg@sorbonne-universite.fr)

Tech keywords: markdown, python, pandoc

1 Like

@greg_incf
Hi,
Myself Sparsh Agrawal. a recent graduate from Nit Surathkal, having 1 year of experience in Industry with real world project experience working with Reliance Jio and have a research paper with Springer India.
I have hands on working experience with Javascript, and Python
I’m really interested in this project and would like to contribute to it
Thanks

Dear @Sparsh_Agrawal, happy to hear that you are interested in our project. As a first step, I’d suggest getting a bit familiar (no need for deep technical understanding) with the Brian simulator itself (e.g. by looking at its documentation/tutorial at https://brian.readthedocs.org), and with the existing markdown export in the brian2tools package. I will get back to you soon with more concrete advice and suggestions for the project proposal.

Until then, please find general advice about the project proposal here: GSoC 2024 | The Brian spiking neural network simulator

Hi! @mstimberg I started playing around with the brian library and brian2tools markdown features.

I’ve integrated pandoc locally and started working on the proposal.

Just wanted to update you on my progress.

Thanks!

1 Like

Hi @mstimberg I think I’m now familiar with the brian scripts. I’d like to know about the template customization here. Are there certain templates we’re intending to use?
I have poc ready for integration with pandoc and tested in my local,
Also, what is a good starting point for Brian’s multi-compartment neuron models?

Hi @Sparsh_Agrawal.

Regarding the templates: The current brian2tools doesn’t use any templates, instead it has code that directly states how all the elements are converted into a paragraph of Markdown code, e.g. here for a NeuronGroup: https://github.com/brian-team/brian2tools/blob/552abd46ba1be15166f8762868753146f84805e0/brian2tools/mdexport/expander.py#L471-L512
The idea would be to use a template instead that gets filled with the relevant information. Since we already use the jinja2 templating engine for Brian’s code generation mechanism, it would make sense to use it here as well.

Regarding pandoc: As a first step, we’d like to make it possible to convert the generated markdown into other formats, such as HTML or PDF. This is quite straightforward with pandoc, so the main work will be integrating it cleanly – make it work with an existing pandoc installation, make it work on Windows, Linux, macOS, etc.

Regarding multi-compartment neurons: unfortunately, our documentation is a bit sparse (in particular, we do not have a tutorial). The best starting point for now would be:

  1. The main documentation: Multicompartment models — Brian 2 2.6.0 documentation
  2. The examples here: Examples — Brian 2 2.6.0 documentation
  3. This (quite complex) example here: Example: Destexhe_et_al_1998 — Brian 2 2.6.0 documentation

Hope that gives you a few pointers!

Hi @mstimberg ,
I have proof of concept ready for pandoc through which it is possible to convert the generated markdown into other formats, such as HTML or PDF.
I have started working on using jinja2 and to figure out how exactly can we use template here.
meanwhile i will send you a draft proposal with in next 3 days
Thanks

Hi @mstimberg
I’ve managed to replicate the same output using a jinja2 template.
Are we expecting some more different output templates other than how the data output is currently rendered?

Hi @Sparsh_Agrawal, cool, glad to hear that. For now, the main goal is not to provide several templates (even though having e.g. two quite different ones would be nice for demonstration purposes). The main goal is to set up the system so that it uses templates and that makes it straightforward for the user to switch to a different template (or set of templates).

Dear @greg_incf and @mstimberg,

I hope this message finds you well.

I am Sachetan Heralagi, a student currently pursuing my degree at KLE Institute of Technology. Recently, I have been deeply engaged in research, particularly focusing on Spiking Neural Networks (SNNs). I find the concept of SNNs intriguing, especially their potential for energy efficiency when compared to conventional Convolutional Neural Networks (CNNs) and Artificial Neural Networks (ANNs).

In my academic journey, I have had the opportunity to explore various neural network architectures, ranging from simple ANNs to more complex models like VGG19. One of the projects I take pride in is leading a team to develop an automated irrigation system using ANN technology for weather prediction and integration with Internet of Things (IoT) devices. Our project even made it to the finals of IEEE YESIST12, which was a significant achievement for us.

Now, I am eager to delve deeper into the world of SNNs, and I believe that brain2 provides an excellent platform for this exploration. I am keen to contribute to projects related to SNNs and to learn from the wealth of knowledge within the brain2 community.

I am reaching out to express my interest in becoming a part of the brain2 community and to inquire about any opportunities to collaborate or contribute to ongoing projects. I am committed to learning and am enthusiastic about the prospect of working together to advance our understanding and application of SNNs.

Thank you for considering my request, and I look forward to the possibility of joining your esteemed community.

Best regards,
Sachetan Heralagi

Hi @Sachetan_heralagi. Happy to hear that you are interested in Brian 2 :blush: Are you interested in the simulator in general, or are you specifically interested in doing a Google Summer of Code internship (in particular, the markdown exporter project mentioned in this thread)? If you are interested in Brian 2 in general, I’d suggest to head over to its website (https://briansimulator.org) and the discussion forum (https://brian.discourse.group) to get a better idea of its community.

i am here for markdown exporter project (gsoc) , but i am also intrested in learning more about SNN and contributing for brian2 simulation .

Ok, great. Just two things to keep in mind:

  1. Brian was created as a simulator for biological neural networks, and this is reflected in its features (e.g. support for physical units). Even though people are using it for SNNs in the ML sense, I’d say it is not its main use case (but of course, the border between research on biological neural networks and artificial neural networks is becoming fuzzy these days).
  2. The markdown exporter project is not itself about simulating networks with Brian, but for improving its feature to document networks. Most of the work will revolve around Python and markdown, and be quite orthogonal to the application domain (i.e. neural network simulation).

Hi @mstimberg
I was going through the structure of SpatialNeuron and thinking of a way to upgrade the BaseExporter for the same…

Can you outline exactly what information or attributes are we looking to extract from it?

Hi @Sparsh_Agrawal. Behind the scenes, a SpatialNeuron is mostly organized like a NeuronGroup (instead of a group of neurons, it represents a single neuron as a group of connected so-called “compartments”). Therefore, the main information is similar: the equations + the initial values set by the user. Additionally, there is the morphology of the neuron (the number of compartments, how they are connected, and their geometries). This is less clear to represent in the export, maybe giving the option to use the plotting functions from Plotting tools — brian2tools documentation would make the most sense. No need to solve all these issues in detail, for now, though, there should still be something left to do for the actual internship :wink:

Hi @mstimberg @greg_incf ,
Here is my draft proposal , kindly review it, and instruct your valuable insights to improve it.

kindly share your email id through which I can share access of this document

Thanks

Hi @Sparsh_Agrawal , please invite me as marcel.stimberg@sorbonne-universite.fr Thanks!

Hi @mstimberg ,
I have shared invite kindly check, it can be accessed by your account

Many thanks, I have access to the document and will give you feedback later today.

:warning: Dear prospective candidates, please be aware that the submission deadline for application proposals is Apr 2nd. Unfortunately (well, not for me :wink: ), I will be away for a break over the Easter weekend and can therefore not give extensive feedback close to the deadline date. Please send me a draft before Wed 27th for detailed feedback. I will still be reachable after that date, but most likely not be able to look into your document in detail. Thanks for your understanding and happy proposal writing :blush: ! :warning: