Skip to main content

Sensor Transformer (SeT)

Adaptation of Vision Transformer (ViT) for Time-Series and Sensor Data in Tensorflow.

Usage

import argparse
import tensorflow as tf
import sensortransformer import set_network

parser = argparse.ArgumentParser()
parser.add_argument("--signal-length", type=int)
parser.add_argument("--segment-size", type=int)
parser.add_argument("--num_channels", type=int)
parser.add_argument("--num_classes", type=int)
args = parser.parse_args()

"""
TF-Data objects. Instances must be of shape 
  x = (batch, signal_length, num_channels), y = (batch, num_classes)
"""
ds_train, ds_test = ...

model = set_network.SensorTransformer(
        signal_length=args.signal_length,
        segment_size=args.segment_size,
        channels=args.num_channels,
        num_classes=args.num_classes,
        num_layers=4,
        d_model=64,
        num_heads=4,
        mlp_dim=64,
        dropout=0.1,
)
model.compile(
    loss=tf.keras.losses.CategoricalCrossentropy(from_logits=True),
      optimizer=tf.keras.optimizers.Adam(),
      metrics=[tf.keras.metrics.CategoricalAccuracy()],
)
model.fit(ds_train, epochs=50, verbose=1)
model.evaluate(ds_test)

Metadata

Release files for sensortransformer 0.1.6

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

Source distribution (sdist)

Source distribution for sensortransformer 0.1.6
File Size Uploaded Provenance Actions
sensortransformer-0.1.6.tar.gz 2.7 kB Without provenance Details for sensortransformer-0.1.6.tar.gz

Built distribution (wheel)

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

Total release size: 6.7 kB

Release files / sensortransformer-0.1.6.tar.gz

Download URL sensortransformer-0.1.6.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3a1c1e6125e84f15962a2346a9b9a627f752c154fa5c02817e5b696d14f1a082
BLAKE2b-256 checksum
How to use checksums
21e2de17db3cf1f529eb35026f29f099653f1b2f3786c2c6a9b6525026bb9a49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release files / sensortransformer-0.1.6-py3-none-any.whl

Download URL sensortransformer-0.1.6-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
711e334390d5abcc9a4826f2d314e8e5d6839e7d5d4c2731110f55a1df28676e
BLAKE2b-256 checksum
How to use checksums
3dbd3b89f5aecd3e603288674560fecd7dfd15b7242aa973cd2f1165b3bd8151
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Security for sensortransformer 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files No provenance

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