Metadata-Version: 2.4
Name: custom-rnn
Version: 0.1.0
Summary: A NumPy-based neural network library featuring RNN, GRU cells, CTC loss/decoding, greedy and beam search decoders — built from scratch without PyTorch.
Author: kkipngenokoech
License-Expression: MIT
Project-URL: Homepage, https://github.com/kkipngenokoech/RNN
Project-URL: Repository, https://github.com/kkipngenokoech/RNN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: numpy

# custom-rnn

A lightweight, NumPy-only neural network library implementing recurrent architectures and CTC (Connectionist Temporal Classification) from scratch.

## Features

- **RNN Cell** — vanilla recurrent neural network cell with forward and backward (BPTT) support
- **GRU Cell** — gated recurrent unit with reset, update, and new gates
- **RNN Phoneme Classifier** — multi-layer RNN for sequence classification
- **Character Predictor** — GRU-based character-level prediction with inference utilities
- **CTC Loss** — full CTC forward-backward algorithm with posterior probability computation
- **CTC Decoding** — greedy search and beam search decoders
- **Neural Network Primitives** — Linear layer, Sigmoid, Tanh, Softmax Cross-Entropy loss

## Installation

```bash
pip install custom-rnn
```

## Quick Start

```python
import numpy as np
from mytorch import RNNCell, GRUCell
from CTC import CTC, CTCLoss, GreedySearchDecoder, BeamSearchDecoder

# Create an RNN cell
rnn = RNNCell(input_size=10, hidden_size=20)
x = np.random.randn(1, 10)
h = np.zeros((1, 20))
h_next = rnn(x, h)

# Create a GRU cell
gru = GRUCell(input_size=10, hidden_size=20)
x = np.random.randn(10)
h = np.zeros(20)
h_next = gru(x, h)

# CTC greedy decoding
symbols = ["a", "b", "c"]
decoder = GreedySearchDecoder(symbols)

# CTC beam search decoding
beam_decoder = BeamSearchDecoder(symbols, beam_width=3)
```

## Requirements

- Python >= 3.8
- NumPy
