%% Set and Get Learning Rate Factor of Learnable Parameter
% Set and get the learning rate factor of a learnable parameter of a custom PReLU layer.
% Define a custom PReLU layer. To create this layer, save the file preluLayer.m in the current folder.
% Create a layer array including the custom layer preluLayer.

layers = [ ...
    imageInputLayer([28 28 1])
    convolution2dLayer(5,20)
    batchNormalizationLayer
    preluLayer(20,'prelu')
    fullyConnectedLayer(10)
    softmaxLayer
    classificationLayer];

% Set the learn rate factor of the 'Alpha' learnable parameter of the preluLayer to 2.

layers(4) = setLearnRateFactor(layers(4),'Alpha',2);

% View the updated learn rate factor.

factor = getLearnRateFactor(layers(4),'Alpha')

% Copyright 2017 The MathWorks, Inc.