Dualing
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6962ad7c24fbf11b277a119adc9efd75298dcb69909ab7f4298b4aeeff895ac
|
|
| MD5 |
55f30bf4ee05506c17db1efa2dc9221e
|
|
| BLAKE2b-256 |
f5a8b39edae57dd27acf78226005d66b56ce27a5648659138d8230f1d2bb12e0
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec6f0b3e3bb7d4fe2475ced5b361f04d65829b15c1ffd4c780c5da31b93fbbea
|
|
| MD5 |
a736867be12485debd92f204abe577fb
|
|
| BLAKE2b-256 |
02338a80d0ff9b3e8c9dc89f4362658608f0c89cb50938d2ed52feb2dfc94bdd
|