Skip to main content

Dualing

CI PyPI Python License

Dualing provides small TensorFlow building blocks for contrastive, cross-entropy, and triplet Siamese networks.

Install

uv add dualing

Dualing requires Python 3.11 or newer.

Quick start

import numpy as np

from dualing import MLP, ContrastiveSiamese, balanced_pair_dataset

samples = np.random.default_rng(0).normal(size=(100, 16))
labels = np.repeat([0, 1], 50)
dataset = balanced_pair_dataset(samples, labels, n_pairs=100, batch_size=16)

model = ContrastiveSiamese(MLP((32, 8)))
model.compile(optimizer="adam")
model.fit(dataset, epochs=5)

Dataset helpers return native tf.data.Dataset objects and all models use standard Keras compile, fit, and evaluate behavior. The original dualing.core, dualing.datasets, dualing.models.base, and dualing.utils APIs remain available.

Development

uv sync
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run --group docs sphinx-build -W -b html docs docs/_build/html
uv build

API documentation is available at dualing.readthedocs.io.

Download files

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

Source Distribution

dualing-2.0.1.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

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

dualing-2.0.1-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file dualing-2.0.1.tar.gz.

File metadata

  • Download URL: dualing-2.0.1.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dualing-2.0.1.tar.gz
Algorithm Hash digest
SHA256 f6962ad7c24fbf11b277a119adc9efd75298dcb69909ab7f4298b4aeeff895ac
MD5 55f30bf4ee05506c17db1efa2dc9221e
BLAKE2b-256 f5a8b39edae57dd27acf78226005d66b56ce27a5648659138d8230f1d2bb12e0

See more details on using hashes here.

File details

Details for the file dualing-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: dualing-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dualing-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec6f0b3e3bb7d4fe2475ced5b361f04d65829b15c1ffd4c780c5da31b93fbbea
MD5 a736867be12485debd92f204abe577fb
BLAKE2b-256 02338a80d0ff9b3e8c9dc89f4362658608f0c89cb50938d2ed52feb2dfc94bdd

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 files

2.0.0

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 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