34 const Shape& = {3, 3, 1, 1},
35 const Shape& = {1, 1},
36 const string& =
"Valid",
37 const string& =
"convolutional_relu_layer");
77 const Shape& = {3, 3, 1, 1},
78 const Shape& = {1, 1},
79 const string& =
"Valid",
80 const string& =
"convolutional_relu_layer");
102 Index input_height = 0;
103 Index input_width = 0;
104 Index input_channels = 0;
106 Index kernels_number = 0;
107 Index kernel_height = 0;
108 Index kernel_width = 0;
109 Index kernel_channels = 0;
111 Index row_stride = 1;
112 Index column_stride = 1;
114 bool use_padding =
false;
118 void update_convolution_operator();
Index get_padding_height() const
Returns the padding applied along the height axis.
Shape get_input_shape() const override
Returns the input tensor shape (height, width, channels).
Definition convolutional_relu_layer.h:40
Shape get_output_shape() const override
Returns the output tensor shape after the fused conv+ReLU.
pair< Index, Index > get_padding() const
Definition convolutional_relu_layer.h:63
void set(const Shape &={0, 0, 0}, const Shape &={3, 3, 1, 1}, const Shape &={1, 1}, const string &="Valid", const string &="convolutional_relu_layer")
Reconfigures the layer with new shapes and convolution settings.
void set_input_shape(const Shape &) override
Updates the layer for a new input shape and reinitializes derived sizes.
Index get_kernel_height() const
Definition convolutional_relu_layer.h:55
ActivationOp::Function get_output_activation() const override
Returns the layer's output activation (Identity for most layers; overridden by Dense/Bounding).
Definition convolutional_relu_layer.h:73
Index get_row_stride() const
Definition convolutional_relu_layer.h:60
void set_row_stride(const Index)
Index get_input_height() const
Definition convolutional_relu_layer.h:51
Index get_output_width() const
Returns the output feature map width.
Index get_input_width() const
Definition convolutional_relu_layer.h:52
void set_column_stride(const Index)
Index get_kernel_width() const
Definition convolutional_relu_layer.h:56
void write_JSON_body(JsonWriter &) const override
Writes the layer configuration to a JSON writer.
void read_JSON_body(const Json *) override
Reads the layer configuration from a JSON node.
Index get_kernels_number() const
Definition convolutional_relu_layer.h:58
Index get_padding_width() const
Returns the padding applied along the width axis.
void on_compute_dtype_changed() override
Rebuilds the fused convolution operator when the compute dtype changes.
Definition convolutional_relu_layer.h:86
ConvolutionalRelu(const Shape &={3, 3, 1}, const Shape &={3, 3, 1, 1}, const Shape &={1, 1}, const string &="Valid", const string &="convolutional_relu_layer")
Constructs a fused convolution+ReLU layer.
Index get_column_stride() const
Definition convolutional_relu_layer.h:61
void set_convolution_type(const string &)
Sets convolution type ("Valid" or "Same") and updates padding.
Index get_output_height() const
Returns the output feature map height.
Index get_kernel_channels() const
Definition convolutional_relu_layer.h:57
Index get_input_channels() const
Definition convolutional_relu_layer.h:53
bool get_use_padding() const
Definition convolutional_relu_layer.h:71
Definition adaptive_moment_estimation.h:14
Function
Supported activation functions.
Definition operators.h:171
@ ReLU
Definition operators.h:171
Fused 2D convolution + ReLU activation (uses cuDNN fused epilogue on GPU).
Definition operators.h:497
Fixed-capacity small-vector describing tensor dimensions (rank up to MaxRank).
Definition tensor_utilities.h:42