This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

getLearnRateFactor

Get learn rate factor of layer learnable parameter

Syntax

factor = getLearnRateFactor(layer,parameterName)

Description

example

factor = getLearnRateFactor(layer,parameterName) returns the learn rate factor of the parameter with the name parameterName in layer.

For built-in layers, you can get the learn rate factor directly by using the corresponding property. For example, for a convolution2dLayer layer, the syntax factor = getLearnRateFactor(layer,'Weights',factor) is equivalent to factor = layer.WeightLearnRateFactor.

Examples

collapse all

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')
factor = 2

Input Arguments

collapse all

Input layer, specified as a scalar Layer object.

Parameter name, specified as a character vector.

Example: 'Alpha'

Data Types: char

Introduced in R2017b