FNN 1.0.0
Toolbox to use NNs in Fortran.
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
fnn_layer::layer Type Reference

Base class for all layers. Do not instanciate. More...

Inheritance diagram for fnn_layer::layer:
Inheritance graph
[legend]

Public Member Functions

procedure, pass, public get_num_parameters => layer_get_num_parameters
 Returns the number of parameters. Implemented by layer_get_num_parameters. More...
 
procedure, pass, public set_parameters => layer_set_parameters
 Setter for layer::parameters. Implemented by layer_set_parameters. More...
 
procedure, pass, public get_parameters => layer_get_parameters
 Getter for layer::parameters. Implemented by layer_get_parameters. More...
 
procedure, pass, public tofile => layer_tofile
 Saves the layer. Implemented by layer_tofile. More...
 
procedure, pass, public apply_forward => layer_apply_forward
 Applies and linearises the layer. Implemented by layer_apply_forward. More...
 
procedure, pass, public apply_tangent_linear => layer_apply_tangent_linear
 Applies the TL of the layer. Implemented by layer_apply_tangent_linear. More...
 
procedure, pass, public apply_adjoint => layer_apply_adjoint
 Applies the adjoint of the layer. Implemented by layer_apply_adjoint. More...
 

Public Attributes

integer(ik), public input_size
 The dimension of the input of the layer. More...
 
integer(ik), public output_size
 The dimension of the output of the layer. More...
 
integer(ik), public batch_size
 The batch size. More...
 
integer(ik), public num_parameters
 The number of (trainable) parameters. More...
 
class(linearactivation), allocatable, public activation
 The activation function. More...
 
real(rk), dimension(:), allocatable, public parameters
 The vector of (trainable) parameters. More...
 
real(rk), dimension(:, :), allocatable, public forward_input
 The storage for the layer::apply_forward method. More...
 
real(rk), dimension(:, :), allocatable, public tangent_linear_input
 The storage for the layer::apply_tangent_linear method. More...
 
real(rk), dimension(:, :), allocatable, public adjoint_input
 The storage for the layer::apply_adjoint method. More...
 

Detailed Description

Base class for all layers. Do not instanciate.

This class only exists to enable polymorphism.

Note

All attributes are public because they need to be accessed in subclasses and in networks. This could be avoided if all layers and networks would be part of the same module.

Member Function/Subroutine Documentation

◆ apply_adjoint()

procedure, pass, public fnn_layer::layer::apply_adjoint

Applies the adjoint of the layer. Implemented by layer_apply_adjoint.

◆ apply_forward()

procedure, pass, public fnn_layer::layer::apply_forward

Applies and linearises the layer. Implemented by layer_apply_forward.

◆ apply_tangent_linear()

procedure, pass, public fnn_layer::layer::apply_tangent_linear

Applies the TL of the layer. Implemented by layer_apply_tangent_linear.

◆ get_num_parameters()

procedure, pass, public fnn_layer::layer::get_num_parameters

Returns the number of parameters. Implemented by layer_get_num_parameters.

◆ get_parameters()

procedure, pass, public fnn_layer::layer::get_parameters

Getter for layer::parameters. Implemented by layer_get_parameters.

◆ set_parameters()

procedure, pass, public fnn_layer::layer::set_parameters

Setter for layer::parameters. Implemented by layer_set_parameters.

◆ tofile()

procedure, pass, public fnn_layer::layer::tofile

Saves the layer. Implemented by layer_tofile.

Member Data Documentation

◆ activation

class(linearactivation), allocatable, public fnn_layer::layer::activation

The activation function.

◆ adjoint_input

real(rk), dimension(:, :), allocatable, public fnn_layer::layer::adjoint_input

The storage for the layer::apply_adjoint method.

Array of reals with shape (layer::output_size, layer::batch_size).

Note

This array can be used by network classes to apply successive layers.

◆ batch_size

integer(ik), public fnn_layer::layer::batch_size

The batch size.

◆ forward_input

real(rk), dimension(:, :), allocatable, public fnn_layer::layer::forward_input

The storage for the layer::apply_forward method.

Array of reals with shape (layer::input_size, layer::batch_size).

Note

This array can be used by network classes to apply successive layers. In addition, this array is used to store the linearisation.

◆ input_size

integer(ik), public fnn_layer::layer::input_size

The dimension of the input of the layer.

◆ num_parameters

integer(ik), public fnn_layer::layer::num_parameters

The number of (trainable) parameters.

◆ output_size

integer(ik), public fnn_layer::layer::output_size

The dimension of the output of the layer.

◆ parameters

real(rk), dimension(:), allocatable, public fnn_layer::layer::parameters

The vector of (trainable) parameters.

All trainable parameters are stored into a single array of reals with shape (layer::num_parameters).

◆ tangent_linear_input

real(rk), dimension(:, :), allocatable, public fnn_layer::layer::tangent_linear_input

The storage for the layer::apply_tangent_linear method.

Array of reals with shape (layer::input_size, layer::batch_size).

Note

This array can be used by network classes to apply successive layers.


The documentation for this type was generated from the following file: