#! /usr/bin/python3 # Last edited on 2020-12-09 14:00:17 by jstolfi # Computes the parameters Iavg, Idev of the Gaussian external inputs. from math import sqrt def compute_Iavg_Idev(K,L,A,F,Delta): """Computes the parameters Iavg, Idev of the Gaussian external inputs that are equivalent to the multiplePoisson inputs of Nilton Kamiji's big network. Prints them to standard output. The parameters {K} and {L} must be lists where {K[i]} is the number of Poisson inputs to each neuron of layer {i}, and {L[i]} is the name of the layer. Each Posson input is assumed to have frequency {F} (Hz) with spikes of integrated amplitude {A} (mV). Assumes discrete-time simulation with step {Delta} (mS). """ for i in range(len(K)): m = K[i] name = L[i] p = F * Delta # Probability of an input firiing in a given time step. Iavg = m * p * A Idev = A * sqrt(m * p*(1-p)) print("%2d %-4s %5d %6.4f %8.4f %8.4f" % (i, name, m, p, Iavg, Idev)) # Input K = [ 1600, 1500, 2100, 1900, 2000, 1900, 2900, 2100 ] L = [ "23E", "23I", "4E", "4I", "5E", "5I", "6E", "6I" ] A = 0.500*87.8/250.0 # Millivots. The factor 0.500 accounts for Nilton's synapse dynamics. F = 8.0 # Herts (spikes per second). Delta = 0.001 # Seconds. compute_Iavg_Idev(K,L,A,F,Delta)