Skip to main content

Disentanglement Datasets

A lightweight package of torchvision-style PyTorch datasets with a focus on flexibility.

Installation

$ pip install pytorch-disentanglement-datasets

Usage

Each dataset returns a dictionary containing at least an input key:

>>> from disentanglement_datasets import DSprites
>>> dataset = DSprites(root="./data", download=True)
>>> dataset[0]
{'input': tensor([[0, 0, 0,  ..., 0, 0, 0],
        [0, 0, 0,  ..., 0, 0, 0],
        [0, 0, 0,  ..., 0, 0, 0],
        ...,
        [0, 0, 0,  ..., 0, 0, 0],
        [0, 0, 0,  ..., 0, 0, 0],
        [0, 0, 0,  ..., 0, 0, 0]], dtype=torch.uint8),
 'latent': tensor([1.0000, 1.0000, 0.5000, 0.0000, 0.0000, 0.0000], dtype=torch.float64)}

This dictionary can be transformed. For example, for self-supervised learning with augmentations you might do something like:

>>> def my_transform(item):
...   view1 = my_random_augmentation(item["input"])
...   view2 = my_random_augmentation(item["input"])
...   return view1, view2
...
>>> dataset = DSprites(root="./data", download=True, transform=my_transform)
>>> dataset[0]
(tensor([[0, 0, 0,  ..., 0, 0, 0],
        [0, 0, 0,  ..., 0, 0, 0],
        [0, 0, 0,  ..., 0, 0, 0],
        ...,
        [0, 0, 0,  ..., 0, 0, 0],
        [0, 0, 0,  ..., 0, 0, 0],
        [0, 0, 0,  ..., 0, 0, 0]], dtype=torch.uint8), tensor([[0, 0, 0,  ..., 0, 0, 0],
        [0, 0, 0,  ..., 0, 0, 0],
        [0, 0, 0,  ..., 0, 0, 0],
        ...,
        [0, 0, 0,  ..., 0, 0, 0],
        [0, 0, 0,  ..., 0, 0, 0],
        [0, 0, 0,  ..., 0, 0, 0]], dtype=torch.uint8))

Datasets and their original sources

Attribution

If this code was useful to you, please cite the original dataset (links above) and this codebase.

BibTeX

TODO

Development

Pull requests are welcome.

See also

Metadata

Release files for pytorch-disentanglement-datasets 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytorch-disentanglement-datasets 0.0.1
File Size Uploaded Provenance Actions
pytorch-disentanglement-datasets-0.0.1.tar.gz 6.7 kB Without provenance Details for pytorch-disentanglement-datasets-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytorch-disentanglement-datasets 0.0.1
File Interpreter ABI Platform Actions
pytorch_disentanglement_datasets-0.0.1-py3-none-any.whl Python 3 none any Details for pytorch_disentanglement_datasets-0.0.1-py3-none-any.whl

Total release size: 14.5 kB

Release files / pytorch-disentanglement-datasets-0.0.1.tar.gz

Download URL pytorch-disentanglement-datasets-0.0.1.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c2aad324bd93d2ffe93eed1c36bf74b4dbd6475c2079d4b365be643fa79c93b8
BLAKE2b-256 checksum
How to use checksums
4f84917aa260abcb80842cff1cb3b9711fcfec803e493d3ab0e229afcd98e269
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Release files / pytorch_disentanglement_datasets-0.0.1-py3-none-any.whl

Download URL pytorch_disentanglement_datasets-0.0.1-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0283e40e2f49f3ec44a9841ce6b986e87d7229c8baa4c3631d0b9c9d056dc838
BLAKE2b-256 checksum
How to use checksums
a57337fd6a6b696ae7fbcdd1aed04b0e0ff2036c36862bb613e1e950a4152483
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Security for pytorch-disentanglement-datasets 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page