Skip to main content

#Synbols

Probing Learning Algorithms with Synthetic Datasets

License CircleCI Documentation Status

Synbols

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.

[paper]

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

Launch the example notebook

We provide an example Jupyter notebook in the examples directory. To run this notebook, first download it locally and run the following command at the notebook's location:

synbols-jupyter

This will launch jupyter notebook in the Synbols runtime environment and allow you to access it via your browser.

Contact

For any bug or feature requests, please create an issue.

Metadata

Release files for synbols 1.0.2

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

Source distribution (sdist)

Source distribution for synbols 1.0.2
File Size Uploaded
synbols-1.0.2.tar.gz 31.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for synbols 1.0.2
File Interpreter ABI Platform
synbols-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 65.2 kB

Release files / synbols-1.0.2.tar.gz

Download URL synbols-1.0.2.tar.gz
Size 31.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6e5d8951ae826a315e00198be2e3b5043641cd7c08c1b78095ec1301a1950192
BLAKE2b-256 checksum
How to use checksums
6423aeffc9eaa93690578aafe4985e7f6a12f4c2a88affe5bd52f0a7839f3ab2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.9

Release files / synbols-1.0.2-py3-none-any.whl

Download URL synbols-1.0.2-py3-none-any.whl
Size 34.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5462c50cc764e928b30b44534f6a568e23e27ae3fdcba5eb61161073d3a98519
BLAKE2b-256 checksum
How to use checksums
7b71b99c36878cf76f7ac7716deb649c351bcf2e15111d98602f34fc48dca52d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.9

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

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