NVIDIA NvNeural SDK  2022.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
nvneural::IInnerActivationLayer Class Referenceabstract

IInnerActivationLayer is an optional interface implemented by layers that fuse pairs of operations. More...

#include <nvneural/LayerTypes.h>

Inheritance diagram for nvneural::IInnerActivationLayer:
nvneural::IRefObject

Public Member Functions

virtual float innerActivationCoefficient (std::size_t coefficientIndex) const noexcept=0
 Retrieves the activation coefficient for the specified index. More...
 
virtual ActivationFunctionId innerActivationFunction () const noexcept=0
 Retrieves the activation function attached to this layer. More...
 
virtual NeuralResult setInnerActivationCoefficient (std::size_t coefficientIndex, float value) noexcept=0
 Sets an inner activation coefficient. More...
 
virtual NeuralResult setInnerActivationFunction (ActivationFunctionId activationFunction) noexcept=0
 Sets the inner activation function. More...
 
- Public Member Functions inherited from nvneural::IRefObject
virtual RefCount addRef () const noexcept=0
 Increments the object's reference count. More...
 
virtual const void * queryInterface (TypeId interface) const noexcept=0
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
virtual void * queryInterface (TypeId interface) noexcept=0
 Retrieves a new object interface pointer. More...
 
virtual RefCount release () const noexcept=0
 Decrements the object's reference count and destroy the object if the reference count reaches zero. More...
 

Static Public Attributes

static const IRefObject::TypeId typeID = 0xff90b9f223475f88ul
 Interface TypeId for InterfaceOf purposes.
 
- Static Public Attributes inherited from nvneural::IRefObject
static const TypeId typeID = 0x14ecc3f9de638e1dul
 Interface TypeId for InterfaceOf purposes.
 

Additional Inherited Members

- Public Types inherited from nvneural::IRefObject
using RefCount = std::uint32_t
 Typedef used to track the number of active references to an object.
 
using TypeId = std::uint64_t
 Every interface must define a unique TypeId. This should be randomized.
 
- Protected Member Functions inherited from nvneural::IRefObject
virtual ~IRefObject ()=default
 A protected destructor prevents accidental stack-allocation of IRefObjects or use with other smart pointer classes like std::unique_ptr.
 

Detailed Description

IInnerActivationLayer is an optional interface implemented by layers that fuse pairs of operations.

Model fusing rules can convert layer_A, layer_B pairs to a single layer_AB. All parameters of the source layers, including those related to activation functions, are forwarded to the fused layer; this interface provides access to the inner activation function without requiring arbitrary support for nested activations in the standard layer interfaces.

Nested activation parameters are also passed inside loadFromParameters as the _1_act and _1_act_alpha parameter names. The former is a string that should match an IClassRegistry-accessible ActivationDesc function ID. The latter is a comma-separated list of floating-point values.

Member Function Documentation

◆ innerActivationCoefficient()

virtual float nvneural::IInnerActivationLayer::innerActivationCoefficient ( std::size_t  coefficientIndex) const
pure virtualnoexcept

Retrieves the activation coefficient for the specified index.

The meaning of this value is activation-specific. If no setActivationCoefficient call was previously issued for this index, the layer should return a default value of zero.

Parameters
coefficientIndexCoefficient index

◆ innerActivationFunction()

virtual ActivationFunctionId nvneural::IInnerActivationLayer::innerActivationFunction ( ) const
pure virtualnoexcept

Retrieves the activation function attached to this layer.

Should return the most recent value passed to setInnerActivationFunction.

◆ setInnerActivationCoefficient()

virtual NeuralResult nvneural::IInnerActivationLayer::setInnerActivationCoefficient ( std::size_t  coefficientIndex,
float  value 
)
pure virtualnoexcept

Sets an inner activation coefficient.

The meaning of this value is activation-specific.

Parameters
coefficientIndexCoefficient index
valueValue to store

◆ setInnerActivationFunction()

virtual NeuralResult nvneural::IInnerActivationLayer::setInnerActivationFunction ( ActivationFunctionId  activationFunction)
pure virtualnoexcept

Sets the inner activation function.

Parameters
activationFunctionFunction to assign.

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