Skip to main content

Data augmentation methods for deep learning (CutMix, MixUp, PuzzleMix)

Project description

mlxops-aug

Data augmentation methods for deep learning, including CutMix, MixUp, and PuzzleMix.

Installation

pip install mlxops-aug

For PuzzleMix support (requires pygco):

pip install "mlxops-aug[puzzlemix]"

Note: pygco requires a C compiler. See pyGCO for installation instructions.

Usage

CutMix / MixUp

from mlxops_aug import CutMixUp

aug = CutMixUp(
    num_classes=10,
    config={
        "use_cutmix": True,
        "use_mixup": True,
        "alpha": 1.0,
        "prob": 0.5,
    },
)

x_aug, y_aug = aug(x, y)

PuzzleMix

from mlxops_aug import PuzzleMix

aug = PuzzleMix(
    num_classes=10,
    config={
        "block_num": 2,
        "transport": True,
        "prob": 1.0,
    },
)

Requirements

  • Python >= 3.10
  • PyTorch >= 2.0
  • torchvision >= 0.15

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mlxops_aug-0.1.9.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mlxops_aug-0.1.9-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file mlxops_aug-0.1.9.tar.gz.

File metadata

  • Download URL: mlxops_aug-0.1.9.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for mlxops_aug-0.1.9.tar.gz
Algorithm Hash digest
SHA256 fe37b4e10ef04b8b38d8e68fb016487eeab39589375d6557d3aff00e6d027373
MD5 31e395bca91ca44041c67849321609f2
BLAKE2b-256 140ea169c02ed274e4832c60d9a55354a830dd78d7efeeb969da0e32fdf89f99

See more details on using hashes here.

File details

Details for the file mlxops_aug-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: mlxops_aug-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for mlxops_aug-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 ef72dd0edbf3a9607ba2bc823c6c543eacb05a35229cd9b1411fd725cfc6772a
MD5 2664aa506b6405e4e1849159e38fddc2
BLAKE2b-256 a2ced32cfef8cb57963d7a8d59824f14a7ec535944e4466ae287fd4a5e8a8849

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page