# Description of problem

If I design spiking neural network where input is Poisson source,1st layer contain 10 neurons, hidden layer contains 20 neurons and output layer contains 5 neurons, if the synaptic connection probability is 0.2,we can easily find the spike times of each layer(input, hidden or output) neurons .But,

(Q1).Is there any way to observe or find interconnection of all neurons, means which source neurons are connected to which destination neurons in the next layer by the synapses(when synaptic connection probability p=0.2,as a result not all the neurons will be connected by synapses)?

(Q2) How can I find the number of spikes transmitted by any source neuron to its destination neuron through synapses, i.e, number of spikes transmitted by each active neuron ?

# Minimal code to reproduce problem

# from brian2 import *

%matplotlib inline

import numpy as np

start_scope()

N = 10

taum = 10*ms*

Ee = 0mV

vt = -50*mV*

vr = -60mV

El = -74*mV*

taue = 5ms

F = 15*Hz*

we=(600.27/10)

eqs_neurons = ‘’’

dv/dt = (ge * (Ee-v) + El - v) / taum : volt

dge/dt = -ge / taue : 1

‘’’

I= PoissonGroup(N, rates=F)

#Input layer

E10 = NeuronGroup(10, eqs_neurons, threshold=‘v>vt’, reset=‘v = vr’,method=‘euler’)

E10.v=‘vr+rand()*(vt-vr)’*

E10.ge=0

S1=Synapses(I,E10,on_pre=‘ge += we’)

S1.connect(p=0.2)

#Hidden layer1

F10 = NeuronGroup(20, eqs_neurons, threshold=‘v>vt’, reset=‘v = vr’, method=‘euler’)

F10.v='vr+rand()(vt-vr)’

F10.ge=0

S2= Synapses(E10,F10,on_pre=‘ge += we’)

S2.connect(p=0.2)

#Output layer

G10= NeuronGroup(5, eqs_neurons, threshold=‘v>vt’, reset=‘v = vr’,method=‘euler’)

G10.v='vr+rand()*(vt-vr)’*

G10.ge=0

S3=Synapses(F10,G10,on_pre=‘ge += we’)

S3.connect(p=0.2)

#INPUT LAYER

K=SpikeMonitor(E10)

#HIDDEN LAYER 1

L=SpikeMonitor(F10)

#OUTPUT LAYER2

M=SpikeMonitor(G10)

run(100ms, report=‘text’)

What you have aready tried

Ee = 0

vr = -60

taue = 5

we=(60

E10.ge=0

S1=Synapses(I,E10,on_pre=‘ge += we’)

S1.connect(p=0.2)

#Hidden layer1

F10 = NeuronGroup(20, eqs_neurons, threshold=‘v>vt’, reset=‘v = vr’, method=‘euler’)

F10.v='vr+rand()

G10.ge=0

S3=Synapses(F10,G10,on_pre=‘ge += we’)

S3.connect(p=0.2)

#INPUT LAYER

K=SpikeMonitor(E10)

#HIDDEN LAYER 1

L=SpikeMonitor(F10)

#OUTPUT LAYER2

M=SpikeMonitor(G10)

run(100

#spike times of all the active neurons in the input layer

print(K.t)

#spike times of all the active neurons in the hidden layer

print(L.t)

#spike times of all the active neurons in the output layer

print(M.t)

# Expected output (if relevant)

NA

# Actual output (if relevant)

NA

# Full traceback of error (if relevant)

NA