Synbols: Probing Learning Algorithms with Synthetic Datasets
Project description
Synbols: Probing Learning Algorithms with Synthetic Datasets
Progress in the field of machine learning has been fueled by the introduction of benchmark datasets pushing the limits of existing algorithms. Enabling the design of datasets to test specific properties and failure modes of learning algorithms is thus a problem of high interest, as it has a direct impact on innovation in the field. In this sense, we introduce Synbols — Synthetic Symbols — a tool for rapidly generating new datasets with a rich composition of latent features rendered in low resolution images. Synbols leverages the large amount of symbols available in the Unicode standard and the wide range of artistic font provided by the open font community. Our tool's high-level interface provides a language for rapidly generating new distributions on the latent features, including various types of textures and occlusions. To showcase the versatility of Synbols, we use it to dissect the limitations and flaws in standard learning algorithms in various learning setups including supervised learning, active learning, out of distribution generalization, unsupervised representation learning, and object counting.
Installation
The easiest way to install Synbols is via PyPI. Simply run the following command:
pip install synbols
Software dependencies
Synbols relies on fonts and system packages. To ensure reproducibility, we provide a Docker image with everything preinstalled. Thus, the only dependency is Docker (see here to install).
Usage
Using predefined generators
$ synbols-datasets --help
$ synbols-datasets --dataset=some-large-occlusion --n_samples=1000 --seed=42
Generating some-large-occlusion dataset. Info: With probability 20%, add a large occlusion over the existing symbol.
Preview generated.
35%|############################2 | 353/1000 [00:05<00:10, 63.38it/s]
Defining your own generator
Examples of how to create new datasets can be found in the examples directory.
def translation(rng):
"""Generates translations uniformly from (-2, 2), going outside of the box."""
return tuple(rng.uniform(low=-2, high=2, size=2))
# Modifies the default attribute sampler to fix the scale to a constant and the (x,y) translation to a new distribution
attr_sampler = basic_attribute_sampler(scale=0.5, translation=translation)
generate_and_write_dataset(dataset_path, attr_sampler, n_samples)
To generate your dataset, you need to run your code in the Synbols runtime environment. This is done using the synbols
command as follows:
synbols mydataset.py --foo bar
Contact
For any bug or feature requests, please create an issue.
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
Built Distribution
File details
Details for the file synbols-0.1.1.tar.gz
.
File metadata
- Download URL: synbols-0.1.1.tar.gz
- Upload date:
- Size: 23.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d3f0bc2d1bdc73b525615cbe43f453494f2da4d14fc0e8887c8ea085f196be6 |
|
MD5 | 70b69a026635f6a0c9393e3c70eb5f2d |
|
BLAKE2b-256 | ddbc144b956a9235b4f2b89bf860c99c8285c2d2b4089a959751fc5d490f2bfa |
File details
Details for the file synbols-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: synbols-0.1.1-py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2c92525866a1ab3ca76f9e40d08d91d36ea67e3dab636ea63e9dcae0c382dee |
|
MD5 | 1af16a38ed96aa9699e8075d43d77231 |
|
BLAKE2b-256 | a38112fcd617d8d155528c162fb6bee635d74f03ba543d8ce7dc78adebef0ca3 |