Output bounding layer that clips outputs to configured lower and upper limits.
More...
|
| | Bounding (const Shape &={0}, const string &="bounding_layer") |
| | Constructs a bounding layer for the given output shape and label.
|
| |
| Shape | get_input_shape () const override |
| | Returns the input shape stored by the layer.
|
| |
| Shape | get_output_shape () const override |
| | Returns the output shape; subclasses must implement this to expose their geometry.
|
| |
| const BoundingMethod & | get_bounding_method () const |
| |
| VectorR | get_lower_bounds () const |
| | Returns the configured lower bound for each output variable.
|
| |
| VectorR | get_upper_bounds () const |
| | Returns the configured upper bound for each output variable.
|
| |
| void | set (const Shape &={0}, const string &="bounding_layer") |
| | Reconfigures the layer with a new output shape and label.
|
| |
| void | set_input_shape (const Shape &) override |
| | Sets the input shape; subclasses override to derive dependent dimensions.
|
| |
| void | set_bounding_method (const BoundingMethod &) |
| | Sets the bounding method enum used to clip outputs.
|
| |
| void | set_bounding_method (const string &) |
| | Sets the bounding method from its string name.
|
| |
| void | set_lower_bounds (const VectorR &) |
| | Sets the full vector of lower bounds, one entry per output variable.
|
| |
| void | set_lower_bound (Index, float) |
| | Sets the lower bound of a single output variable by index.
|
| |
| void | set_upper_bounds (const VectorR &) |
| | Sets the full vector of upper bounds, one entry per output variable.
|
| |
| void | set_upper_bound (Index, float) |
| | Sets the upper bound of a single output variable by index.
|
| |
| float * | link_states (float *) override |
| | Binds the persistent-state region of the shared buffer to operator views.
|
| |
| void | read_JSON_body (const Json *) override |
| | Subclass hook reading the body section of the layer's JSON node.
|
| |
| void | write_JSON_body (JsonWriter &) const override |
| | Subclass hook writing the body section of the layer's JSON node.
|
| |
| 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).
|
| |
| virtual | ~Layer ()=default |
| |
| const string & | get_label () const |
| |
| const string & | get_name () const |
| |
| LayerType | get_type () const |
| |
| virtual void | set_output_shape (const Shape &) |
| | Sets the output shape; subclasses override when the output is user-configurable.
|
| |
| void | set_label (string new_label) |
| |
| Index | get_parameters_number () const |
| | Returns the total number of trainable parameters owned by this layer.
|
| |
| const vector< Operator * > & | get_operators () const |
| |
| virtual vector< TensorSpec > | get_parameter_specs () const |
| | Returns the tensor specs of trainable parameters; subclasses override.
|
| |
| virtual vector< TensorSpec > | get_state_specs () const |
| | Returns the tensor specs of persistent state (e.g. running mean/variance).
|
| |
| virtual vector< TensorSpec > | get_forward_specs (Index batch_size) const |
| | Returns the tensor specs of the forward workspace; defaults to a single output tensor.
|
| |
| virtual vector< TensorSpec > | get_backward_specs (Index batch_size) const |
| | Returns the tensor specs of the backward workspace; empty for non-trainable layers.
|
| |
| virtual ActivationOp::Function | get_output_activation () const |
| | Returns the layer's output activation (Identity for most layers; overridden by Dense/Bounding).
|
| |
| Index | get_inputs_number () const |
| |
| Index | get_outputs_number () const |
| |
| virtual void | forward_propagate (ForwardPropagation &fp, size_t layer, bool is_training) noexcept |
| | Runs the forward pass by chaining the layer's operators in order.
|
| |
| virtual void | back_propagate (ForwardPropagation &fp, BackPropagation &bp, size_t i) const noexcept |
| | Runs the backward pass by chaining the layer's operators in reverse order.
|
| |
| virtual void | from_JSON (const JsonDocument &document) |
| | Restores layer configuration and parameters from a JSON document.
|
| |
| virtual void | load_state_from_JSON (const JsonDocument &document) |
| | Restores persistent state (e.g. running statistics) from a JSON document.
|
| |
| virtual void | to_JSON (JsonWriter &writer) const |
| | Serializes layer configuration and parameters to a JSON writer.
|
| |
| virtual void | print () const |
| | Prints a human-readable summary of the layer to standard output.
|
| |
| bool | get_is_trainable () const |
| |
| Type | get_compute_dtype () const |
| |
| void | set_compute_dtype (Type new_compute_dtype) |
| | Sets the compute dtype and notifies subclasses via on_compute_dtype_changed().
|
| |
| virtual void | on_compute_dtype_changed () |
| | Subclass hook invoked when the compute dtype changes; default is no-op.
|
| |
| float * | link_gradients (float *pointer, vector< TensorView > &gradient_views) |
| | Binds the gradient slice of the shared buffer to operator gradient views.
|
| |
| vector< TensorView > & | get_parameter_views () |
| |
| const vector< TensorView > & | get_parameter_views () const |
| |
| void | redistribute_parameters_to_operators () |
| | Re-binds operator parameter views after the parameter buffer has been resized or moved.
|
| |
Output bounding layer that clips outputs to configured lower and upper limits.