Skip to content

Commit

Permalink
Merge pull request #338 from Neuroblox/sDCMforGUI
Browse files Browse the repository at this point in the history
WIP: adapt sDCM code for GUI integration
  • Loading branch information
david-hofmann authored Mar 11, 2024
2 parents f50db9b + b69eddb commit 072bc20
Show file tree
Hide file tree
Showing 4 changed files with 361 additions and 86 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
SignalAnalysis = "df1fea92-c066-49dd-8b36-eace3378ea47"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Expand Down
28 changes: 27 additions & 1 deletion src/Neuroblox.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,32 @@ abstract type BloxConnectMultiComplex <: BloxConnection end
# dictionary type for Blox parameters
Para_dict = Dict{Symbol, Union{<: Real, Num}}

# struct types for Variational Laplace
mutable struct VLState
iter::Int
v::Float64 # log ascent rate
F::Vector{Float64}
dF::Vector{Float64}
λ::Vector{Float64}
ϵ_θ::Vector{Float64}
reset_state::Vector{Any}
μθ_po::Vector{Float64}
Σθ_po::Matrix{Float64}
dFdθ::Vector{Float64}
dFdθθ::Matrix{Float64}
end

struct VLSetup
model_at_x0
y_csd::Array{Complex}
tolerance::Float64
systemnums::Vector{Int}
systemvecs::Vector{Vector{Float64}}
systemmatrices::Vector{Matrix{Float64}}
Q::Matrix{Complex}
end


include("utilities/spectral_tools.jl")
include("utilities/learning_tools.jl")
include("utilities/bold_methods.jl")
Expand Down Expand Up @@ -199,7 +225,7 @@ export add_blox!
export powerspectrum, complexwavelet, bandpassfilter, hilberttransform, phaseangle, mar2csd, csd2mar, mar_ml
export learningrate, ControlError
export boldsignal, BalloonModel
export vecparam, csd_Q, spectralVI
export vecparam, csd_Q, setup_sDCM, run_sDCM_iteration!
export simulate, random_initials
export system_from_graph, graph_delays
export create_adjacency_edges!, adjmatrixfromdigraph
Expand Down
Loading

0 comments on commit 072bc20

Please sign in to comment.