GrFNN input

Current code (April 28, 2015):

"""

# process external signal (stimulus)
if layer.stimulus_conn_type == 'linear':
    x = layer.w * x_stim
elif layer.stimulus_conn_type == 'active':
    x = layer.w * x_stim * active(z, layer.zparams.sqe)
elif layer.stimulus_conn_type == 'allfreq':
    x = layer.w * passiveAllFreq(x_stim, layer.zparams.sqe) * \
        active(z, layer.zparams.sqe)
elif layer.stimulus_conn_type == 'all2freq':
    x = layer.w * passiveAll2Freq(x_stim, layer.zparams.sqe) * \
        active(z, layer.zparams.sqe)
else:
    raise Exception("Unknown stimulus connection type '{}'".format(
        layer.stimulus_conn_type))

# process coupled GrFNNs (internal, afferent and efferent)
for (source_z, conn) in connections:
    matrix, conn_type = conn.matrix, conn.conn_type
    if conn_type == '1freq':
        x = x + conn.weights * matrix.dot(source_z)
    elif conn_type == '2freq':
        x = x + conn.weights * twoFreq(z, source_z,
                                       conn.farey_num, conn.farey_den,
                                       matrix,
                                       layer.zparams.e)
    elif conn_type == '3freq':
        x = x + conn.weights * threeFreq(z, source_z,
                                         conn.monomials,
                                         layer.zparams.e)
    elif conn_type == 'allfreq':
        x = x + conn.weights * \
            matrix.dot(passiveAll2Freq(source_z, layer.zparams.sqe)) * \
            active(z, layer.zparams.sqe)
    elif conn_type == 'all2freq':
        x = x + conn.weights * \
            matrix.dot(passiveAllFreq(source_z, layer.zparams.sqe)) * \
            active(z, layer.zparams.sqe)
    else:
        raise Exception("Unknown connection type '{}'".format(conn_type))

return x

"""

In math:

Let $w_i$ denote layer.w. Be default $w_i = f_i = \omega_i/2\pi$


In [ ]: