Skip to content

feat: add GRU layer alongside LSTM #154

Description

@ulises-jeremias

Only LSTM exists. GRU is a simpler and often more efficient recurrent unit.

Task

Following the pattern of nn/layers/lstm.v and nn/internal/lstm.v:

  1. Add nn/layers/gru.v — GRU layer definition
  2. Add nn/internal/gru.v — CPU forward/backward kernels
  3. Add GRU gate files for autograd
  4. Add GRU test case

Stretch

  • CUDA/Vulkan forward if GPU support is desired

Verification

  • GRU forward matches PyTorch (nn.GRU) for same weights
  • Backward gradients are correct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions