Metadata-Version: 2.4
Name: dl-experiment-code
Version: 1.0.0
Summary: Ready-to-use Deep Learning experiment code for experiments 5-10 and a NumPy RNN from scratch
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# Deep Learning Experiment Code Package

This package provides ready-to-use code for:

- Experiment 5: CNN image classification
- Experiment 6: CNN hyperparameter tuning
- Experiment 7: Autoencoder dimensionality reduction
- Experiment 8: Educational single-object detection
- Experiment 9: LSTM sentiment analysis
- Experiment 10: LSTM hyperparameter tuning
- Additional: Vanilla RNN implemented from scratch with NumPy

For experiments 5-10 there are two versions:

1. `local` - uses a local CSV/image/Pascal VOC dataset.
2. `online` - uses a Keras dataset or an online TensorFlow Datasets dataset.

The code follows the structure and concepts of the supplied original experiments.

## Installation

From this folder:

```bash
pip install .
```

For development/editable installation:

```bash
pip install -e .
```

## List experiments

```bash
dlab-code list
```

## Get code

Online/Keras dataset version:

```bash
dlab-code get 5 --dataset online
```

Local dataset version:

```bash
dlab-code get 5 --dataset local
```

Experiments 6-10 work the same way:

```bash
dlab-code get 6 --dataset online
dlab-code get 7 --dataset local
dlab-code get 8 --dataset online
dlab-code get 9 --dataset local
dlab-code get 10 --dataset online
```

## Save directly to a Python file

```bash
dlab-code get 5 --dataset online --save exp5.py
```

Then:

```bash
python exp5.py
```

## RNN from scratch

```bash
dlab-code get rnn-scratch
```

Or save it:

```bash
dlab-code get rnn-scratch --save rnn_from_scratch.py
```

The RNN uses NumPy only for the recurrent computation and manually implements:

- hidden-state calculation
- output calculation
- loss
- backpropagation through time
- gradient clipping
- parameter updates

## Dataset notes

### Experiment 5
- Online: Keras CIFAR-10
- Local: image directory with one folder per class

### Experiment 6
- Online: Keras CIFAR-10
- Local: image directory with one folder per class

### Experiment 7
- Online: Keras MNIST
- Local: numeric CSV

### Experiment 8
- Online: Pascal VOC through TensorFlow Datasets
- Local: Pascal VOC-style images + XML annotations

The object detector is deliberately educational and predicts the first object in an image. It is not a production multi-object detector.

### Experiment 9
- Online: Keras IMDB
- Local: `text,label` CSV

### Experiment 10
- Online: Keras IMDB
- Local: `text,label` CSV

## Dependencies for running generated code

Install the common ML stack:

```bash
pip install tensorflow scikit-learn pandas numpy matplotlib pillow
```

Experiment 8 online additionally needs:

```bash
pip install tensorflow-datasets
```

The package itself has no heavy ML dependency because it only generates/prints the code.
