Skip to content

Small, self-contained PyTorch datasets that generate random samples on-the-fly for quick experiments and testing.

License

Notifications You must be signed in to change notification settings

ajaynr/torch_random_dataset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

random_dataset

Small, self-contained PyTorch datasets that generate random samples on-the-fly for quick experiments and testing.

Features

  • Random regression data: (x, y) from standard normal
  • Random grayscale image classification data: image values in [0, 1], integer labels
  • Deterministic per-index sampling with an optional seed
  • Configurable number of samples

Usage

from random_dataset import RandomRegressionDataset, RandomImageDataset

# Regression: x in R^m, y in R^n
reg = RandomRegressionDataset(num_samples=10_000, input_size=16, output_size=3, seed=42)
x, y = reg[0]

# Grayscale image classification: (1, H, W) image, integer label
img = RandomImageDataset(num_samples=50_000, image_size=28, num_classes=10, seed=42)
image, label = img[0]

Running tests

python -m unittest test_imports.py

Project structure

random_dataset/             # Package root
├─ __init__.py              # Re-exports the public API
├─ core.py                  # Dataset implementations
├─ test_imports.py          # Minimal unittest for import & basic access
└─ README.md                # This file

Requirements

  • Python 3.9+
  • PyTorch (torch)

License

EUPL-1.2. See the LICENSE file or https://eupl.eu/1.2/en/ for details.

About

Small, self-contained PyTorch datasets that generate random samples on-the-fly for quick experiments and testing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages