38 void set(
const Shape& = {0},
const string& =
"bounding_layer");
68 const vector<string>& output_names)
const override;
74 vector<float> lower_bounds;
75 vector<float> upper_bounds;
78 bool op_storage_dirty =
true;
82 void refresh_op_storage(
Device device);
void set_upper_bounds(const VectorR &)
Sets the full vector of upper bounds, one entry per output variable.
Shape get_output_shape() const override
Returns the output shape; subclasses must implement this to expose their geometry.
Definition bounding_layer.h:28
float * link_states(float *) override
Binds the persistent-state region of the shared buffer to operator views.
void write_JSON_body(JsonWriter &) const override
Subclass hook writing the body section of the layer's JSON node.
void set_lower_bound(Index, float)
Sets the lower bound of a single output variable by index.
BoundOp::Method BoundingMethod
Definition bounding_layer.h:22
Shape get_input_shape() const override
Returns the input shape stored by the layer.
Definition bounding_layer.h:27
void set_lower_bounds(const VectorR &)
Sets the full vector of lower bounds, one entry per output variable.
VectorR get_lower_bounds() const
Returns the configured lower bound for each output variable.
void set_bounding_method(const string &)
Sets the bounding method from its string name.
const BoundingMethod & get_bounding_method() const
Definition bounding_layer.h:30
void read_JSON_body(const Json *) override
Subclass hook reading the body section of the layer's JSON node.
VectorR get_upper_bounds() const
Returns the configured upper bound for each output variable.
void set_bounding_method(const BoundingMethod &)
Sets the bounding method enum used to clip outputs.
void set(const Shape &={0}, const string &="bounding_layer")
Reconfigures the layer with a new output shape and label.
string write_expression(const vector< string > &input_names, const vector< string > &output_names) const override
Returns a human-readable mathematical expression for this layer (empty by default).
void set_input_shape(const Shape &) override
Sets the input shape; subclasses override to derive dependent dimensions.
Bounding(const Shape &={0}, const string &="bounding_layer")
Constructs a bounding layer for the given output shape and label.
void set_upper_bound(Index, float)
Sets the upper bound of a single output variable by index.
Definition adaptive_moment_estimation.h:14
Device
Execution device selection for OpenNN runtime (auto-detected, CPU or CUDA GPU).
Definition configuration.h:17
Matrix< float, Dynamic, 1 > VectorR
Definition pch.h:181
Clamps each output channel to a configurable lower/upper interval.
Definition operators.h:1004
Method
Disables bounding or enables per-channel clamping.
Definition operators.h:1006
Owning raw byte buffer that lives on CPU or CUDA memory, with aligned (re)allocation.
Definition tensor_utilities.h:166
Fixed-capacity small-vector describing tensor dimensions (rank up to MaxRank).
Definition tensor_utilities.h:42