Metadata-Version: 2.4
Name: squeeznet
Version: 0.1.2
Summary: A lightweight PyTorch implementation of SqueezeNet
Author: Sleeping AI
Keywords: pytorch,deep-learning,computer-vision,squeezenet,cnn,cifar10
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: torch
Requires-Dist: torchvision

# SqueezeNet

A lightweight PyTorch implementation of **SqueezeNet** for image classification.

This implementation provides the SqueezeNet architecture using Fire modules, with support for training and evaluation on CIFAR-10. The project is designed to keep the architecture simple, readable, and easy to modify for research and experimentation.

## Architecture

SqueezeNet achieves parameter efficiency through **Fire modules**. Each Fire module consists of:

* A `1×1` squeeze convolution that reduces the number of channels.
* A `1×1` expand convolution.
* A `3×3` expand convolution.
* Channel-wise concatenation of the two expand branches.

A simplified Fire module looks like:

```text
                 Input
                   │
                   ▼
             1×1 Squeeze
                   │
             ┌─────┴─────┐
             ▼           ▼
         1×1 Expand   3×3 Expand
             │           │
             └─────┬─────┘
                   ▼
             Concatenate
                   │
                   ▼
                  ReLU
```

## Installation

Install from PyPI:

```bash
pip install squeeznet
```

For development, clone the repository and install it in editable mode:

```bash
git clone <repository-url>
cd squeeznet
pip install -e .
```

## Usage

Create a SqueezeNet model:

```python
from squeeznet import SqueezeNet

model = SqueezeNet()
print(model)
```

The default implementation is configured for **10-class image classification**.

## Training

The package includes a training pipeline for CIFAR-10.

```python
from squeeznet import Trainer

trainer = Trainer(
    batch_size=64,
    epochs=55,
    lr=0.001,
    weight_decay=0.01,
)

trainer.fit()
```

The trainer automatically uses CUDA or Apple Metal Performance Shaders (MPS) when available and otherwise falls back to the CPU.

The best-performing model checkpoint is saved during training.

## Dataset

The included CIFAR-10 data pipeline provides separate training and testing transformations.

Training includes random horizontal flipping followed by normalization, while evaluation uses normalization without random augmentation.

## Requirements

* Python 3.10+
* PyTorch
* Torchvision

## Package Structure

```text
squeeznet/
├── model.py
├── dataset.py
├── train.py
└── __init__.py
```

`model.py` contains the SqueezeNet and Fire module implementations.

`dataset.py` contains the CIFAR-10 dataset and DataLoader configuration.

`train.py` contains the training and evaluation pipeline.

## License

See the repository license for licensing information.

## Author

Written by **Sleeping AI**.
