silver-torch
An optional PyTorch layer for Silver. It turns a small Silver preprocessing
program into a fitted, inspectable, reusable tensor and DataLoader pipeline.
pip install silver-data
pip install 'silver-torch[pytorch]'
from silver_data import Dataset
from silver_torch import compile_silver
program = """
pipeline ieee_inverse:
features voltage, current, phase, sensor
categorical sensor
label fault
architecture transformer
sequence_length 2
scaling standard
missing median
label_type classification
batch_size 128
num_workers 2
cache_dir .cache/ieee_inverse
"""
dataset = Dataset.from_records("ieee", [
{"voltage": 1.0, "current": 2.0, "phase": 0.2, "fault": 0},
{"voltage": 1.2, "current": 2.1, "phase": 0.3, "fault": 1},
])
splits = dataset.split(0.8, 0.1, 0.1)
pipeline = compile_silver(program).fit(splits.train.records())
loader = pipeline.dataloader(splits.validation.records(), device="cuda")
print(pipeline.plan(device="cuda").to_dict())
print(pipeline.benchmark(splits.validation.records(), steps=20))
The compiler has explicit research-safety boundaries:
- statistics and vocabularies are fitted only on
splits.train; - missing columns, non-finite numbers, invalid labels, and incompatible sequence lengths fail loudly;
- categorical vocabularies are sorted for reproducibility and reserve index 0 for unknown values;
- classification targets are
torch.long; regression targets use the chosen floating dtype; - cache keys include the fitted-training fingerprint and transformed rows, and cache writes are atomic;
- loaders are seeded and tune pinning, persistent workers, prefetching, and
drop_lastbased on the declared runtime.
The emitted shapes are [batch, features] for MLP, [batch, 1, features] for
CNN, and [batch, sequence_length, features_per_step] for RNN/Transformer.
These are layout contracts, not model implementations. Measure with
benchmark() on the target machine; input speedups depend on storage, CPU,
worker count, batch size, and accelerator.
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 silver_torch-0.1.0.tar.gz.
File metadata
- Download URL: silver_torch-0.1.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2342495352968fc2911c054ec4e2ec1720d5b941eb44abbe418e463e3e430153
|
|
| MD5 |
945b9f69c0576a25395101e93a041e86
|
|
| BLAKE2b-256 |
e9d018c6a6346c2ac589f0139264f5e06e9f655bdb2bae3f32b6c7d282d65233
|
Provenance
The following attestation bundles were made for silver_torch-0.1.0.tar.gz:
Publisher:
release.yml on adfgdartec/silver-torch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
silver_torch-0.1.0.tar.gz -
Subject digest:
2342495352968fc2911c054ec4e2ec1720d5b941eb44abbe418e463e3e430153 - Sigstore transparency entry: 2423061979
- Sigstore integration time:
-
Permalink:
adfgdartec/silver-torch@a36a48a89fa2ee714f0957f2a9ad938f3f925699 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/adfgdartec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a36a48a89fa2ee714f0957f2a9ad938f3f925699 -
Trigger Event:
push
-
Statement type:
File details
Details for the file silver_torch-0.1.0-py3-none-any.whl.
File metadata
- Download URL: silver_torch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19226dc3c6b81fe552b42abef71a4e088bbc381abc0af23cf29391cb5545c866
|
|
| MD5 |
bc685ebc1a3d8c841959936200492ff1
|
|
| BLAKE2b-256 |
ddfca44a6c60ef25ff43780764c2ba2d63cf4fc8cc4cb2a9909d32a8fd69e443
|
Provenance
The following attestation bundles were made for silver_torch-0.1.0-py3-none-any.whl:
Publisher:
release.yml on adfgdartec/silver-torch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
silver_torch-0.1.0-py3-none-any.whl -
Subject digest:
19226dc3c6b81fe552b42abef71a4e088bbc381abc0af23cf29391cb5545c866 - Sigstore transparency entry: 2423061990
- Sigstore integration time:
-
Permalink:
adfgdartec/silver-torch@a36a48a89fa2ee714f0957f2a9ad938f3f925699 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/adfgdartec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a36a48a89fa2ee714f0957f2a9ad938f3f925699 -
Trigger Event:
push
-
Statement type: