Revision b90e189a9e1a4d0cdda097d435fa91b1236f1866 authored by comp-neural-circuits on 18 January 2021, 09:01:37 UTC, committed by GitHub on 18 January 2021, 09:01:37 UTC
1 parent aa4f64f
Raw File
biased_weights.m
function W = biased_weights(N_in, W_initial, bias, spread)
% This function generates biased initial weights along the 
% diagonal of the connectivity matrix.
% written by Ling-Ya Chao in 2016
    W = zeros(N_in);

    for i = 0 : floor(N_in / 2)
        for j = 1 : N_in
            W(j, mod(j + i - 1, N_in) + 1) = normpdf(i, 0, spread);
            W(j, mod(j - i - 1, N_in) + 1) = normpdf(i, 0, spread);
        end
    end

    W = W / normpdf(0, 0, spread);
    W = bias * W + W_initial(1) + (W_initial(2) - W_initial(1)) * rand(N_in);
    W(W < 0) = 0;
end




back to top