72 const vector<string>& output_names)
const override;
77 Index input_features = 0;
85 string activation_function =
"Tanh";
vector< TensorSpec > get_backward_specs(Index batch_size) const override
Returns the tensor specifications used during back propagation.
vector< TensorSpec > get_parameter_specs() const override
Returns the tensor specifications for the trainable parameters.
void set(const Shape &={}, const Shape &={})
Reconfigures the layer with new input and output shapes.
const string & get_activation_function() const
Definition recurrent_layer.h:35
vector< TensorSpec > get_forward_specs(Index batch_size) const override
Returns the tensor specifications used during forward propagation.
Recurrent(const Shape &={0, 0}, const Shape &={0})
Constructs a recurrent layer with input and output shapes.
void read_JSON_body(const Json *) override
Reads the layer configuration from a JSON node.
void forward_propagate(ForwardPropagation &, size_t, bool) noexcept override
Runs the forward pass, unrolling the recurrence across time steps.
const TensorView & get_input_weights() const
Definition recurrent_layer.h:33
Shape get_output_shape() const override
Returns the output tensor shape (hidden units).
const TensorView & get_recurrent_weights() const
Definition recurrent_layer.h:34
void back_propagate(ForwardPropagation &, BackPropagation &, size_t) const noexcept override
Runs the backward pass (backpropagation through time).
void set_output_shape(const Shape &) override
Updates the layer for a new output shape.
void set_activation_function(const string &)
Sets the activation function by name (e.g. "Tanh", "ReLU").
string write_expression(const vector< string > &input_names, const vector< string > &output_names) const override
Returns a symbolic expression of the layer for export.
void write_JSON_body(JsonWriter &) const override
Writes the layer configuration to a JSON writer.
const TensorView & get_biases() const
Definition recurrent_layer.h:32
Shape get_input_shape() const override
Returns the input tensor shape (time_steps, input_features).
Definition recurrent_layer.h:27
void set_input_shape(const Shape &) override
Updates the layer for a new input shape.
Definition adaptive_moment_estimation.h:14
Tensor< float, 2, Layout|AlignedMax > Tensor2
Definition pch.h:189
Workspace holding parameter gradients and per-layer deltas during a backward pass.
Definition back_propagation.h:21
Workspace holding the activations of every layer during a forward pass.
Definition forward_propagation.h:20
Fixed-capacity small-vector describing tensor dimensions (rank up to MaxRank).
Definition tensor_utilities.h:42
Non-owning view over a tensor: pointer, shape, and data type with rich reshape helpers.
Definition tensor_utilities.h:293