1function W = debugInitializeWeights(fan_out, fan_in) 2%DEBUGINITIALIZEWEIGHTS Initialize the weights of a layer with fan_in 3%incoming connections and fan_out outgoing connections using a fixed 4%strategy, this will help you later in debugging 5% W = DEBUGINITIALIZEWEIGHTS(fan_in, fan_out) initializes the weights 6% of a layer with fan_in incoming connections and fan_out outgoing 7% connections using a fix set of values 8% 9% Note that W should be set to a matrix of size(1 + fan_in, fan_out) as 10% the first row of W handles the "bias" terms 11% 12 13% Set W to zeros 14W = zeros(fan_out, 1 + fan_in); 15 16% Initialize W using "sin", this ensures that W is always of the same 17% values and will be useful for debugging 18W = reshape(sin(1:numel(W)), size(W)) / 10; 19 20% ========================================================================= 21 22end 23 24