NeuralFieldEq.jl

NeuralFieldEq.jl: A flexible solver to compute Neural Field Equations in several scenarios - Published in JOSS (2022)

https://github.com/tiagoseq/neuralfieldeq.jl

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: springer.com, joss.theoj.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

differential-equations fast-fourier-transform integral-equations julia numerical-analysis numerical-methods
Last synced: 6 months ago · JSON representation

Repository

NeuralFieldEq.jl: An efficient solver to compute Neural Field Equations in several scenarios

Basic Info
  • Host: GitHub
  • Owner: tiagoseq
  • License: mit
  • Language: Julia
  • Default Branch: master
  • Homepage:
  • Size: 10.4 MB
Statistics
  • Stars: 8
  • Watchers: 3
  • Forks: 2
  • Open Issues: 0
  • Releases: 4
Topics
differential-equations fast-fourier-transform integral-equations julia numerical-analysis numerical-methods
Created over 5 years ago · Last pushed over 3 years ago
Metadata Files
Readme License

README.md

NeuralFieldEq.jl

| Docs | Build Status | |:----:|:----------------------------------------------------------------------------------------------------------------------------------------------------------:| | docs | Build codecov |

Publications

About

The numerical method implemented in NeuralFieldEq.jl was developed within the scope of the thesis Sequeira 2021 under the supervision of professor Pedro M. Lima. The method combined the novel numerical scheme published originally by Hutt & Rougier 2013 for delayed NFE in the context of the stochastic scenario presented by Kuehn & Riedler 2014 where the convergence of spectral methods was proved in stochastic neural fields with additive white noise and spatial correlation.

Hence, this package aims to numerically approximate solutions of Neural Field Equations in one- or two-dimensional spaces, with or without delay and in the deterministic or stochastic scenarios described below.

Installation

NeuralFieldEq.jl requires Julia version 1.5 or greater. You can install Julia here. Once installation is complete, open a Julia REPL and run the following code to install the package: julia using Pkg Pkg.add("NeuralFieldEq")

Dependencies

The package will install the following dependencies FFTW.jl, Distributions.jl, ProgressMeter.jl and LinearAlgebra.jl.

Documentation

Please check the documentation to get started with neural field equations and with the solver itself

Brief overview

The solver is divided into three steps: - Introduce the parameters and functions using the structures Input1D or Input2D; - Pre-process the NFE using the function probNFE; - Solve the equation using the function solveNFE at time instants chosen by the user, with or without noise.

With respect to the structures Input1D and Input2D, they are needed to wrap the inputs needed to define our NFE. They have the following order: - α :: AbstractFloat: Decay rate - v :: AbstractFloat: Axonal speed - V0 :: fV0 : Initial condition (constant or a function) - L :: Number : Domain's length - N :: Integer : Number of spatial nodes - T :: AbstractFloat: Time span - n :: Integer : Number of time nodes - I :: fI : External input function - K :: fK : Connectivity function - S :: fS : Firing rate function

Remark 1: The function I, depending on the domain dimension, has to have x,t or x,y,t as its arguments. Function K has x or x,y. Function S with V.

Once we define our input structure, we can now pass as input to function probNFE, where the NFE is prepared to be solved using the function solveNFE.

Remark 2: Currently, to work with the non-delayed problem, the velocity to insert must satisfy the condition: v>L/(sqrt(2)*Δt) in 2D and v>L/(2*Δt) in 1D, meaning that in practice the user must specify a big velocity (ex.: 999999.0)

The solver has the following generic structure: ```julia nfe = Input1D(α,v,V0,L,N,T,n,I,K,S); # Wrap the inputs in structure Input1D prob = probNFE(nfe) # Pre-process the NFE to be computed

Solve the deterministic 1D problem

Vdet = solveNFE(prob,[t1,t2,t3]) # solution saved at t1, t2, and t3

Solve the stochastic 1D problem np times

ϵ level of additive noise, spatial correlation (0.1 default value)

Vsto = solveNFE(prob,[t1,t2,t3],ϵ,np,ξ=0.1) Vsto2 = solveNFE(prob,[t1,t2,t3],ϵ,np,0.15) # solution w/ xi=0.15 spatial corr ```

Example: Neural field with breather type instabilities

```julia using NeuralFieldEq, Plots

Define functions

I(x,y,t) = (5.0/(32.0pi))exp(-(x^2+y^2)/32.0) function K(x,y) A = 20.0/(10.0pi) B = 14.0/(18.0pi) return Aexp(-sqrt(x^2+y^2)) - Bexp(-sqrt(x^2+y^2)/3.0) end S(V) = V <=0.005 ? 0.0 : 1.0 # heaviside function H(V-0.005)

Define parameters

a = 1.0 V0 = 0.0 L = 20 N = 256 T = 80.0 n = 1600 tj = 0:0.2:T; # Instants to save the solution

Wrap inputs and prepare the NFEs to be computed

nfev5 = Input2D(a,5.0,V0,L,N,T,n,I,K,S); # Solution with v=5 nfev3 = Input2D(a,3.0,V0,L,N,T,n,I,K,S); # Solution with v=3 probv5 = probNFE(nfev5) probv3 = probNFE(nfev3)

Solve NFEs

Vv5 = solveNFE(probv5,tj) Vv3 = solveNFE(probv3,tj) ``` Check the for the animated solutions of these problems and other examples.

Check the Example section of the documentation, for the animated solutions to these problems and many other examples.

Support and contributions

The software in this repository was developed as part of academic research carried out in the context of the master's thesis Numerical Simulations of One- and Two-dimensional Stochastic Neural Field Equations with Delay. If you would like to help support it, please star the repository, consider to use the solver in your research, give your valuable feedback, and feel free to contribute to the package. Improving the documentation, giving ideas and suggestions, contributing lines of code, etc.

Any issues that you find, please, report here.

List of features to implement

  • [ ] Define a new FFT implementation in this module (as indicated in the readme of AbstractFFTs.jl)
  • [ ] Refactor the code in order to handle the 1D and 2D cases generically (so, no longer the need to have 1D and 2D versions of the same function)
  • [ ] Write the non-delayed case $v=\infty$ of the solver
  • [ ] Add the possibility of handling single-precision floats (Float32). Currently it only supports double-precision floats
  • [ ] Add new numerical schemes with higher order of convergence in time (such as the Milstein method)
  • [ ] Add new numerical methods with higher order of convergence in space (in this case the advantage of the speed of FFTs will be lost)
  • [ ] Better solution handling

Contributors

Owner

  • Name: Tiago
  • Login: tiagoseq
  • Kind: user

JOSS Publication

NeuralFieldEq.jl: A flexible solver to compute Neural Field Equations in several scenarios
Published
July 04, 2022
Volume 7, Issue 75, Page 3974
Authors
Tiago Sequeira ORCID
Instituto Superior Técnico - University of Lisbon
Editor
Jarvist Moore Frost ORCID
Tags
Computational Neuroscience Neural Field Equations Stochastic Processes Delayed Equations Fast Fourier Transforms

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 6
  • Total Committers: 2
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.167
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Tiago 7****q 5
Jarvist Moore Frost j****t@g****m 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 14
  • Total pull requests: 18
  • Average time to close issues: 1 day
  • Average time to close pull requests: 7 months
  • Total issue authors: 3
  • Total pull request authors: 2
  • Average comments per issue: 1.21
  • Average comments per pull request: 0.22
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 17
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • tiagoseq (12)
  • rougier (1)
  • JuliaTagBot (1)
Pull Request Authors
  • github-actions[bot] (17)
  • jarvist (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 4
juliahub.com: NeuralFieldEq

NeuralFieldEq.jl: An efficient solver to compute Neural Field Equations in several scenarios

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 9.9%
Average: 31.1%
Forks count: 33.3%
Dependent packages count: 38.9%
Stargazers count: 42.3%
Last synced: 6 months ago