This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_softmax(x,y) = log(exp(x) + exp(y)) | |
# Steady-state functions | |
# Input vectors | |
V0 = -50.0 | |
u0 = zeros(Float64, 13) | |
p = zeros(Float64, 8) | |
# Initial state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Flux, Distributions | |
# Layer for LIF neurons: | |
struct LIFNeurons | |
dt | |
W_inputs # size(in) array input weights | |
W_rex_inputs # length(in)xlength(in) array recurrent excitation weights | |
tau_mem | |
tau_syn | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in libcimplot_api.jl | |
function GetStyle() | |
ccall((:ImPlot_GetStyle, libcimplot), Ptr{ImPlotStyle}, ()) | |
end | |
# elsewhere... | |
# This could have mistakes, and will need tweaking but gets the idea across |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DifferentialEquations, ModelingToolkit, Plots, OrdinaryDiffEq | |
# Channel gating functions | |
αn(V) = (0.01*(V + 55))/(1 - exp(-(V + 55)/10)) | |
βn(V) = 0.125 * exp(-(V + 65)/80) | |
αm(V) = (0.1*(V + 40))/(1 - exp(-(V + 40)/10)) | |
βm(V) = 4*exp(-(V + 65)/18) | |
αh(V) = 0.07*exp(-(V+65)/20) | |
βh(V) = 1/(1 + exp(-(V + 35)/10)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DifferentialEquations, ModelingToolkit, Plots | |
# Channel gating functions | |
αn(V) = (0.01*(V + 55))/(1 - exp(-(V + 55)/10)) | |
βn(V) = 0.125 * exp(-(V + 65)/80) | |
αm(V) = (0.1*(V + 40))/(1 - exp(-(V + 40)/10)) | |
βm(V) = 4*exp(-(V + 65)/18) | |
αh(V) = 0.07*exp(-(V+65)/20) | |
βh(V) = 1/(1 + exp(-(V + 35)/10)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CImGui | |
using CImGui.CSyntax | |
using CImGui.CSyntax.CStatic | |
using CImGui.GLFWBackend | |
using CImGui.OpenGLBackend | |
using CImGui.GLFWBackend.GLFW | |
using CImGui.OpenGLBackend.ModernGL | |
using Printf | |
import CImGui.OpenGLBackend.ModernGL: glGenTextures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CImGui | |
using CImGui.CSyntax | |
using CImGui.CSyntax.CStatic | |
using CImGui.GLFWBackend | |
using CImGui.OpenGLBackend | |
using CImGui.GLFWBackend.GLFW | |
using CImGui.OpenGLBackend.ModernGL | |
using Printf | |
using CEnum | |
using CImPlot_jll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This caused the first breaking change. Precompilation fails after commit 99d2406c98a720e9f9e555109297b577232a01a4 | |
# Result is identical to that reported in CUDAnative.jl at https://github.com/JuliaLang/julia/issues/32074 | |
signal (11): Segmentation fault | |
in expression starting at none:0 | |
jl_is_submodule at /home/wikphi/julia-src/src/module.c:706 | |
module_in_worklist at /home/wikphi/julia-src/src/dump.c:227 [inlined] | |
type_in_worklist at /home/wikphi/julia-src/src/dump.c:238 [inlined] | |
jl_serialize_value_ at /home/wikphi/julia-src/src/dump.c:982 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Test | |
# Reference pattern for N = 13; should be able to generalize pattern to any int N | |
index1=[ | |
1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,4,5,6,7,8,9,10,11,12,13,13,13,13,13,13,13,13,13, | |
13,13,13,13,12,11,10,9,8,7,6,5,4,3,2,2,2,2,2,2,2,2,2,2,2,2,3,4,5,6,7,8,9,10,11, | |
12,12,12,12,12,12,12,12,12,12,12,11,10,9,8,7,6,5,4,3,3,3,3,3,3,3,3,3,3,4,5,6,7, | |
8,9,10,11,11,11,11,11,11,11,11,11,10,9,8,7,6,5,4,4,4,4,4,4,4,4,5,6,7,8,9,10,10, | |
10,10,10,10,10,9,8,7,6,5,5,5,5,5,5,6,7,8,9,9,9,9,9,8,7,6,6,6,6,7,8,8,8,7,7] |