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

cleanup PR for Neuroblox 0.3 #324

Merged
merged 24 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b428247
removed commented out sections in GUI.jl and made ObserverBlox not sh…
helmutstrey Jan 12, 2024
f32d74c
Remove old component tests
agchesebro Jan 15, 2024
f710111
Update LinearNeuralMass
agchesebro Jan 15, 2024
b82b62f
Update LinearNeuralMass
agchesebro Jan 15, 2024
ec8d1d9
Update HarmonicOscillator
agchesebro Jan 15, 2024
d407535
Update Jansen Rit
agchesebro Jan 15, 2024
5bb3fe0
Try fixing escape sequence for LaTeX
agchesebro Jan 15, 2024
8ca6748
Ok now I've really fixed the docstring issue
agchesebro Jan 15, 2024
87cdcb7
Removed failing tests
agchesebro Jan 16, 2024
b088df2
Final tidying of neural mass blocks (for now)
agchesebro Jan 16, 2024
e8fbd00
Removed additional failing tests
agchesebro Jan 16, 2024
b344c27
David code cleanup. Note that I collapsed compileparameterlist and pr…
david-hofmann Jan 17, 2024
5ee0c95
Clean up exports
agchesebro Jan 17, 2024
4f3c763
removed libraries from spectralDCM.jl, removed aliases for libraries
david-hofmann Jan 19, 2024
4498b95
Additional cleanup
agchesebro Jan 23, 2024
fd9d8a1
Final tidying
agchesebro Jan 23, 2024
19fcb4e
added blox connectors for CMC and SPM12 based Jansen-Rit. TODO: find …
david-hofmann Jan 24, 2024
1ab4738
added get functions for weight matrices as well as for parts of compo…
david-hofmann Jan 24, 2024
071b9bc
new canonical micro circuit based on system from graph code-base rath…
david-hofmann Jan 24, 2024
2d6ef22
mini edit
david-hofmann Jan 24, 2024
7948534
Merge branch 'cleanup04' of https://github.com/Neuroblox/Neuroblox.jl…
david-hofmann Jan 24, 2024
9ee9c9d
minor cleanup of Neuroblox.jl
david-hofmann Jan 24, 2024
a402a74
remove ODEfromGraph code-base and related functions in Neurographs.jl
david-hofmann Jan 24, 2024
e6aee0b
Merge branch 'master' into cleanup04
david-hofmann Jan 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ok now I've really fixed the docstring issue
Also removed a couple other old blocks. One more commit and I should be done with this
  • Loading branch information
agchesebro committed Jan 15, 2024
commit 8ca6748b5d95032b2376941cfe1215800a7b6741
46 changes: 34 additions & 12 deletions src/blox/neural_mass.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ This is a blox of the sort used for spectral DCM modeling.
The formal definition of this blox is:
"""

```math
\\frac{d}{dx} = \\sum{jcn}
```
# ```math
# \\frac{d}{dx} = \\sum{jcn}
# ```
"""
where ``jcn`` is any input to the blox.

Expand Down Expand Up @@ -120,10 +120,10 @@ end
Create a harmonic oscillator blox with the specified parameters.
The formal definition of this blox is:
"""
```math
\\frac{dx}{dt} = y-(2*\\omega*\\zeta*x)+ k*(2/\\pi)*(atan((\\sum{jcn})/h)
\\frac{dy}{dt} = -(\\omega^2)*x
```
# ```math
# \\frac{dx}{dt} = y-(2*\\omega*\\zeta*x)+ k*(2/\\pi)*(atan((\\sum{jcn})/h)
# \\frac{dy}{dt} = -(\\omega^2)*x
# ```
"""
where ``jcn`` is any input to the blox.

Expand Down Expand Up @@ -160,10 +160,10 @@ end
Create a Jansen Rit blox as described in Liu et al.
The formal definition of this blox is:
"""
```math
\\frac{dx}{dt} = y-\\frac{2}{\\tau}x
\\frac{dy}{dt} = -\\frac{x}{\\tau^2} + \\frac{H}{\\tau} [\\frac{2\\lambda}{1+\\text{exp}(-r*\\sum{jcn})} - \\lambda]
```
# ```math
# \\frac{dx}{dt} = y-\\frac{2}{\\tau}x
# \\frac{dy}{dt} = -\\frac{x}{\\tau^2} + \\frac{H}{\\tau} [\\frac{2\\lambda}{1+\\text{exp}(-r*\\sum{jcn})} - \\lambda]
# ```
"""
where ``jcn`` is any input to the blox.

Expand Down Expand Up @@ -248,7 +248,29 @@ struct WilsonCowan <: NeuralMassBlox
end

"""
Units note: From Yamashita et al. paper, designed to be in ms. Good to go for now.
JansenRit(name, namespace, τ, H, λ, r, cortical)

Create a Jansen Rit blox as described in Liu et al.
The formal definition of this blox is:
"""
# ```math
# \\frac{dx}{dt} = y-\\frac{2}{\\tau}x
# \\frac{dy}{dt} = -\\frac{x}{\\tau^2} + \\frac{H}{\\tau} [\\frac{2\\lambda}{1+\\text{exp}(-r*\\sum{jcn})} - \\lambda]
# ```
"""
where ``jcn`` is any input to the blox.

Arguments:
- `name`: Name given to `ODESystem` object within the blox.
- `namespace`: Additional namespace above `name` if needed for inheritance.
- `τ`: Time constant. This is changed from the original source as the time constant was in seconds, while all our blocks are in milliseconds.
- `H`: See equation for use.
- `λ`: See equation for use.
- `r`: See equation for use.
- `cortical`: Boolean to determine whether to use cortical or subcortical parameters. Specifying any of the parameters above will override this.

Citations:
1. Endo H, Hiroe N, Yamashita O. Evaluation of Resting Spatio-Temporal Dynamics of a Neural Mass Model Using Resting fMRI Connectivity and EEG Microstates. Front Comput Neurosci. 2020 Jan 17;13:91. doi: 10.3389/fncom.2019.00091.
"""
struct LarterBreakspear <: NeuralMassBlox
params
Expand Down
9 changes: 3 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ using SafeTestsets
# @time @safetestset "Fitting Tests" begin include("fitting.jl") end
# @time @safetestset "Bayesian Fitting Tests" begin include("bayesian_fitting.jl") end

# Extra tests for comparison across blox versions
#@time @safetestset "New Jansen-Rit Tests" begin include("jansen_rit_component_tests_new_timing.jl") end
#@time @safetestset "Old Jansen-Rit Tests" begin include("old_component_tests/jansen_rit_tests.jl") end
#@time @safetestset "Old Wilson-Cowan Tests" begin include("old_component_tests/wilson_cowan_tests.jl") end
#@time @safetestset "New Larter-Breakspear Tests" begin include("new_LB_blox.jl") end
#@time @safetestset "Old Larter-Breakspear Tests" begin include("old_component_tests/larter_breakspear_tests.jl") end
# Extra tests illustrating use - could be removed once examples are written
#@time @safetestset "New Jansen-Rit Tests" begin include("jansen_rit_component_tests.jl") end
#@time @safetestset "New Larter-Breakspear Tests" begin include("new_LB_blox.jl") end