%% Set and Get Learn Rate Factor of dlnetwork Learnable Parameter
% Set and get the learning rate factor of a learnable parameter of a dlnetwork object.
% Create a dlnetwork object.

layers = [
    imageInputLayer([28 28 1],'Normalization','none','Name','in')
    convolution2dLayer(5,20,'Name','conv')
    batchNormalizationLayer('Name','bn')
    reluLayer('Name','relu')
    fullyConnectedLayer(10,'Name','fc')
    softmaxLayer('Name','sm')];

lgraph = layerGraph(layers);

dlnet = dlnetwork(lgraph);

% Set the learn rate factor of the 'Weights' learnable parameter of the convolution layer to 2 using the setLearnRateFactor function.

factor = 2;
dlnet = setLearnRateFactor(dlnet,'conv','Weights',factor);

% Get the updated learn rate factor using the getLearnRateFactor function.

factor = getLearnRateFactor(dlnet,'conv','Weights')

% Copyright 2020 The MathWorks, Inc.