recurrent

package
v1.25.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package recurrent provides recurrent neural network layers.

Stability: beta

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpleRNN

type SimpleRNN[T tensor.Numeric] struct {
	// contains filtered or unexported fields
}

SimpleRNN is a simple recurrent neural network layer.

func NewSimpleRNN

func NewSimpleRNN[T tensor.Numeric](
	name string,
	engine compute.Engine[T],
	ops numeric.Arithmetic[T],
	inputDim, hiddenDim int,
) (*SimpleRNN[T], error)

NewSimpleRNN creates a new SimpleRNN layer.

func (*SimpleRNN[T]) Attributes

func (r *SimpleRNN[T]) Attributes() map[string]interface{}

Attributes returns the attributes of the layer.

func (*SimpleRNN[T]) Backward

func (r *SimpleRNN[T]) Backward(ctx context.Context, mode types.BackwardMode, outputGradient *tensor.TensorNumeric[T], inputs ...*tensor.TensorNumeric[T]) ([]*tensor.TensorNumeric[T], error)

Backward computes the gradients.

func (*SimpleRNN[T]) Forward

func (r *SimpleRNN[T]) Forward(ctx context.Context, inputs ...*tensor.TensorNumeric[T]) (*tensor.TensorNumeric[T], error)

Forward computes the forward pass of the layer.

func (*SimpleRNN[T]) OpType

func (r *SimpleRNN[T]) OpType() string

OpType returns the operation type of the layer.

func (*SimpleRNN[T]) OutputShape

func (r *SimpleRNN[T]) OutputShape() []int

OutputShape returns the output shape of the layer.

func (*SimpleRNN[T]) Parameters

func (r *SimpleRNN[T]) Parameters() []*graph.Parameter[T]

Parameters returns the parameters of the layer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL