FNN 1.0.0
Toolbox to use NNs in Fortran.
Loading...
Searching...
No Matches
Data Types | Functions/Subroutines
fnn_activation_nonlinear Module Reference

Module dedicated to the class nonlinearactivation. More...

Data Types

type  nonlinearactivation
 Base class for nonlinear activation functions. Do not instanciate. More...
 

Functions/Subroutines

type(nonlinearactivation) function, public construct_nonlinear_activation (self_size, batch_size)
 Constructor for class nonlinearactivation. More...
 
subroutine nonlinear_apply_tangent_linear (self, member, dz, dy)
 Implements nonlinearactivation::apply_tangent_linear. More...
 
subroutine nonlinear_apply_adjoint (self, member, dy, dz)
 Implements nonlinearactivation::apply_adjoint. More...
 

Detailed Description

Module dedicated to the class nonlinearactivation.

Function/Subroutine Documentation

◆ construct_nonlinear_activation()

type(nonlinearactivation) function, public fnn_activation_nonlinear::construct_nonlinear_activation ( integer(ik), intent(in)  self_size,
integer(ik), intent(in)  batch_size 
)

Constructor for class nonlinearactivation.

Parameters
[in]self_sizeThe value for linearactivation::self_size.
[in]batch_sizeThe value for linearactivation::batch_size.
Returns
The constructed activation function.

◆ nonlinear_apply_adjoint()

subroutine fnn_activation_nonlinear::nonlinear_apply_adjoint ( class(nonlinearactivation), intent(in)  self,
integer(ik), intent(in)  member,
real(rk), dimension(:), intent(in)  dy,
real(rk), dimension(:), intent(out)  dz 
)
private

Implements nonlinearactivation::apply_adjoint.

Applies the adjoint of the activation function.

The adjoint operator reads

\[ d\mathbf{z} = \mathbf{A}(\mathbf{z})^\top d\mathbf{y}.\]

Note

In principle, this method should only be called after linearactivation::apply_forward, where the linearisation is computed.

Parameters
[in]selfThe activation function.
[in]memberThe index inside the batch.
[in]dyThe input of the adjoint operator.
[out]dzThe output of the adjoint operator.

◆ nonlinear_apply_tangent_linear()

subroutine fnn_activation_nonlinear::nonlinear_apply_tangent_linear ( class(nonlinearactivation), intent(in)  self,
integer(ik), intent(in)  member,
real(rk), dimension(:), intent(in)  dz,
real(rk), dimension(:), intent(out)  dy 
)
private

Implements nonlinearactivation::apply_tangent_linear.

Applies the TL of the activation function.

The TL operator reads

\[ d\mathbf{y} = \mathbf{A}(\mathbf{z}) d\mathbf{z}.\]

Note

In principle, this method should only be called after linearactivation::apply_forward, where the linearisation is computed.

Parameters
[in]selfThe activation function.
[in]memberThe index inside the batch.
[in]dzThe input of the TL operator.
[out]dyThe output of the TL operator.