ConstantPlusLayer

ConstantPlusLayer[]

represents a layer that adds a learnable bias to its input.

ConstantPlusLayer[opts]

includes options for initial bias and other parameters.

Details and Options

Examples

open allclose all

Basic Examples  (2)

Create a ConstantPlusLayer:

Create an initialized ConstantPlusLayer whose input is a vector of length 3:

Apply the layer to an input vector:

Scope  (3)

Create a ConstantPlusLayer that operates on scalars:

Apply the layer to an input:

The layer threads across a batch of examples:

Plot the output of the layer as a function of the input, compared to y=x:

Use a ConstantPlusLayer in a NetChain to independently bias the components of the output of another layer:

Plot the three output components:

Create a random ConstantPlusLayer that applies a per-pixel and per-channel bias to an image:

Options  (1)

"Biases"  (1)

Specify an initial bias:

Apply the layer to an input vector:

Properties & Relations  (1)

By default, NetInitialize will create a bias that is composed of zeros:

This is the identity initialization, as it leaves the input unchanged:

Specify a custom distribution to NetInitialize:

Possible Issues  (1)

ConstantPlusLayer cannot accept symbolic inputs:

Introduced in 2017
 (11.1)
 |
Updated in 2020
 (12.1)