Skip to content

Instantly share code, notes, and snippets.

View russelljjarvis's full-sized avatar
:octocat:
Focusing

Russell Jarvis russelljjarvis

:octocat:
Focusing
View GitHub Profile
@russelljjarvis
russelljjarvis / Potjans_model_wiring_for_SNN.jl
Last active May 17, 2023 05:02
Potjans model wiring for SNN.jl
using SparseArrays
using StaticArrays
using ProgressMeter
using LinearAlgebra
"""
This file contains a function stack that creates a network with Potjans and Diesmann wiring likeness in Julia using SpikingNeuralNetworks.jl to simulate
electrical neural network dynamics.
This code draws heavily on the PyNN OSB Potjans implementation code found here:
https://github.com/OpenSourceBrain/PotjansDiesmann2014/blob/master/PyNN/network_params.py#L139-L146
@russelljjarvis
russelljjarvis / cell_model.jl
Last active March 10, 2023 23:26
cell_model.jl @rafaqz
"""
I destroyed the generalness of the previous typing system which only worked for mutable kwarg structs
This approach works but with unsophisticated typing.
"""
abstract type AbstractIFParameter end
struct IFParameter# <: AbstractIFParameter
τm::Float32# = 20ms

Hi Raf

For a while I have been trying to massage this Python model into Julia, in part unsuccessfully.

https://portal.brain-map.org/explore/models/mv1-all-layers

The model is interesting for your grid simulator, as the neurons are arranged in pixel like grids (cells have both cartesian pixel indexs, and spatial coordinates).

Hi @ali-mehrabi,
To automatic docker building in github. Click on the tab "actions" in your repository.
Then you can create an action similar to this:
https://github.com/pabloabur/brian2-sims/blob/main/.github/workflows/docker-image.yml#L18-L20
lines 18-20 build and run the dockerfile.
@russelljjarvis
russelljjarvis / potjans_param.jl
Created February 15, 2023 07:31
potjans_param.jl
include("src/genWeightsPotjans.jl")
ccu = Dict("23E"=>20683,
"4E"=>21915,
"5E"=>4850,
"6E"=>14395, "6I"=>2948, "23I"=>5834,"5I"=>1065,"4I"=>5479)
ccu = Dict((k,ceil(Int64,v)) for (k,v) in pairs(ccu))
Ncells = sum([i for i in values(ccu)])+1
@russelljjarvis
russelljjarvis / Potjans_init.jl
Created February 15, 2023 07:29
Potjans_init.jl
sing LinearAlgebra, Random, Statistics, StatsBase, ArgParse, SymmetricFormats
using Plots
using StatsBase
using Random
using ProgressMeter
using StatsPlots
using Plots
#using UnicodePlots
unicodeplots()
@russelljjarvis
russelljjarvis / GenPotjansWeightMatrix.jl
Last active February 15, 2023 08:02
GenPotjansWeightMatrix.jl
using SparseArrays
#using ProgressMeter
using UnicodePlots
function potjans_params(scale_N_cells=1.0)
"""
This code draws heavily on the PyNN OSB Potjans implementation code found here:
https://github.com/OpenSourceBrain/PotjansDiesmann2014/blob/master/PyNN/network_params.py#L139-L146
"""
conn_probs = [[0.1009, 0.1689, 0.0437, 0.0818, 0.0323, 0., 0.0076, 0. ],
[0.1346, 0.1371, 0.0316, 0.0515, 0.0755, 0., 0.0042, 0. ],
@russelljjarvis
russelljjarvis / Dockerfile
Last active February 14, 2023 03:58
Example of reproducible building
https://github.com/scidash/sciunit/blob/master/docker/Dockerfile
```
FROM jupyter/datascience-notebook
RUN apt-get update && \
apt-get upgrade -y
# Install Python, pip and swig
RUN apt-get install -yq --no-install-recommends python3-dev python3-pip swig gosu nano
import numpy as np
import pandas as pd
import json
import pickle
from pathlib import Path
from sonata.circuit import File
from sonata.reports.spike_trains import SpikeTrains
import pygenn
import matplotlib.pyplot as plt
from GLIF_models import GLIF1