# selfweight_diag_connection_impl

Connection for layers of the same representation. The input to the target layer is calculated as follows. For each element, sum an excitatory component and an inhibitory component. The excitatory component is `excitation` multiplied by the corresponding value on the source. The inhibitionory component is the product of a selfweighting value and a mismatch value. The selfweighting value is `extra_inhibition` times source value plus `inhibition`. The mismatch value is the sum of the absolute values of all non-corresponding values on the source.

    target_i=exc*source_i+(inh+extra_inh*source_i)*sum_j_not_i(abs(source_j))

## Parameters

    parameter		default_value
    inhibition		0
    extra_inhibition	0
    excitation		0