Fused 2D convolution + ReLU activation (uses cuDNN fused epilogue on GPU). More...
#include <operators.h>
Public Member Functions | |
| void | set (Index input_h, Index input_w, Index kernels_n, Index kernel_h, Index kernel_w, Index kernel_c, Index row_stride, Index column_stride, Index padding_h, Index padding_w, Type compute_dtype) |
| Configures the underlying ConvolutionOp; ReLU is fixed. | |
| vector< TensorSpec > | parameter_specs () const override |
| Returns the tensor specs of trainable parameters owned by this operator. | |
| void | link_parameters (span< const TensorView > views) override |
| Binds parameter views provided by the hosting layer. | |
| void | link_gradients (span< const TensorView > views) override |
| Binds gradient views provided by the hosting layer. | |
| void | set_parameters_random () override |
| Initializes parameters with random values. | |
| void | set_parameters_glorot () override |
| Initializes parameters using Glorot (Xavier) initialization. | |
| void | destroy_cuda () override |
| Releases CUDA resources owned by the operator; called from destructors. | |
| ~ConvolutionReluOp () override | |
| ConvolutionReluOp ()=default | |
| ConvolutionReluOp (const ConvolutionReluOp &)=delete | |
| ConvolutionReluOp & | operator= (const ConvolutionReluOp &)=delete |
| void | forward_propagate (ForwardPropagation &fp, size_t layer, bool is_training) noexcept override |
| Runs the operator's forward computation. | |
| void | back_propagate (ForwardPropagation &fp, BackPropagation &bp, size_t layer) const noexcept override |
| Runs the operator's backward computation, accumulating into gradient/delta buffers. | |
Public Member Functions inherited from opennn::Operator | |
| virtual | ~Operator ()=default |
| virtual vector< TensorSpec > | state_specs () const |
| Returns the tensor specs of persistent state owned by this operator. | |
| virtual void | link_states (span< const TensorView >) |
| Binds state views provided by the hosting layer. | |
| virtual void | to_JSON (JsonWriter &) const |
| Serializes the operator configuration to a JSON writer. | |
| virtual void | from_JSON (const Json *) |
| Restores the operator configuration from a JSON node. | |
| virtual void | load_state_from_JSON (const Json *) |
| Restores persistent state (e.g. running statistics) from a JSON node. | |
| TensorView & | get_input (ForwardPropagation &fp, size_t layer, size_t i=0) const noexcept |
| vector< TensorView > & | get_inputs (ForwardPropagation &fp, size_t layer, size_t i=0) const noexcept |
| TensorView & | get_output (ForwardPropagation &fp, size_t layer, size_t i=0) const noexcept |
| TensorView & | get_output_delta (BackPropagation &bp, size_t layer, size_t i=0) const noexcept |
| TensorView & | get_input_delta (BackPropagation &bp, size_t layer, size_t i=0) const noexcept |
Public Attributes | |
| ConvolutionOp | convolution |
| ActivationOp | activation |
Public Attributes inherited from opennn::Operator | |
| vector< size_t > | input_slots = {0} |
| vector< size_t > | output_slots = {1} |
| vector< size_t > | input_delta_slots = {1} |
| vector< size_t > | output_delta_slots = {0} |
Detailed Description
Fused 2D convolution + ReLU activation (uses cuDNN fused epilogue on GPU).
Constructor & Destructor Documentation
◆ ~ConvolutionReluOp()
|
inlineoverride |
◆ ConvolutionReluOp() [1/2]
|
default |
◆ ConvolutionReluOp() [2/2]
|
delete |
Member Function Documentation
◆ back_propagate()
|
overridevirtualnoexcept |
Runs the operator's backward computation, accumulating into gradient/delta buffers.
- Parameters
-
fp Forward propagation workspace (read-only). bp Back propagation workspace receiving gradients and deltas. layer Index of the hosting layer in the workspace.
Reimplemented from opennn::Operator.
◆ destroy_cuda()
|
inlineoverridevirtual |
Releases CUDA resources owned by the operator; called from destructors.
Reimplemented from opennn::Operator.
◆ forward_propagate()
|
overridevirtualnoexcept |
Runs the operator's forward computation.
- Parameters
-
fp Forward propagation workspace. layer Index of the hosting layer in the workspace. is_training If true, enables training-only behavior (e.g. dropout sampling).
Reimplemented from opennn::Operator.
◆ link_gradients()
|
inlineoverridevirtual |
Binds gradient views provided by the hosting layer.
Reimplemented from opennn::Operator.
◆ link_parameters()
|
inlineoverridevirtual |
Binds parameter views provided by the hosting layer.
Reimplemented from opennn::Operator.
◆ operator=()
|
delete |
◆ parameter_specs()
|
inlineoverridevirtual |
Returns the tensor specs of trainable parameters owned by this operator.
Reimplemented from opennn::Operator.
◆ set()
| void opennn::ConvolutionReluOp::set | ( | Index | input_h, |
| Index | input_w, | ||
| Index | kernels_n, | ||
| Index | kernel_h, | ||
| Index | kernel_w, | ||
| Index | kernel_c, | ||
| Index | row_stride, | ||
| Index | column_stride, | ||
| Index | padding_h, | ||
| Index | padding_w, | ||
| Type | compute_dtype ) |
Configures the underlying ConvolutionOp; ReLU is fixed.
◆ set_parameters_glorot()
|
inlineoverridevirtual |
Initializes parameters using Glorot (Xavier) initialization.
Reimplemented from opennn::Operator.
◆ set_parameters_random()
|
inlineoverridevirtual |
Initializes parameters with random values.
Reimplemented from opennn::Operator.
Member Data Documentation
◆ activation
| ActivationOp opennn::ConvolutionReluOp::activation |
◆ convolution
| ConvolutionOp opennn::ConvolutionReluOp::convolution |
Public Member Functions inherited from