This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

RegressionOutputLayer class

Regression output layer


RegressionOutputLayer is a class containing the loss function, and name of the layer. To solve a regression problem, you must include a fully connected layer followed by a regression layer at the end of the network.


routputlayer = regressionLayer() returns a regression output layer for a neural network as a RegressionOutputLayer object.

routputlayer = regressionLayer('Name',Name) returns a regression layer with the name specified by Name.

Input Arguments

expand all

Layer name, specified as the comma-separated pair consisting of Name and a character vector. If you do not specify a name, the software specifies the default value '', and at training time the software specifies the name 'regressionoutputlayer'.

Example: 'Name','routput'

Data Types: char


expand all

Loss function the software uses for training, specified by a character vector. The only possible value is 'mean-squared-error'.

Data Types: char

Layer name, specified by a character vector. If Name is set to '', then the software automatically assigns a name at training time.

Data Types: char

Names of responses, specified by a cell array. If you do not specify the response names, the software initially specifies the default value {}, and automatically assigns the response names at training time.

Data Types: cell

Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects (MATLAB) in the MATLAB® documentation.


expand all

Create a regression output layer with the name 'routput'.

routputlayer = regressionLayer('Name','routput')
routputlayer = 

  RegressionOutputLayer with properties:

             Name: 'routput'
    ResponseNames: {}

     LossFunction: 'mean-squared-error'

The default loss function for regression is mean-squared-error.

Was this topic helpful?