Skip to main content

AIronTools

AIronTools (Beta) is a Python library that provides the user with deep learning tools built to work with tensorflow (or pytorch in the future) as a backend.

Key features:

  1. Model constructor that allows multiple models to be optimized in parallel across multiple GPUs.
  2. Block constructor to build customised blocks/models.
  3. Layer constructor to build customised layers.
  4. Preprocessing utils.

Installation

pip install airontools

Custom Keras subclass to build a variational autoencoder (VAE) with airontools

import tensorflow as tf
from tensorflow.keras.datasets import mnist
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Layer, Reshape
from tensorflow.keras.metrics import Mean
from tensorflow.keras.losses import binary_crossentropy
from tensorflow.keras.optimizers import Adam

os.environ['AIRONSUIT_BACKEND'] = 'tensorflow'
from aironsuit.suit import AIronSuit
from airontools.preprocessing import train_val_split
from airontools.model_constructors import layer_constructor

class VAE(Model):
    def __init__(self, latent_dim, **kwargs):
        super(VAE, self).__init__(**kwargs)

        self.total_loss_tracker = Mean(name="total_loss")
        self.reconstruction_loss_tracker = Mean(name="reconstruction_loss")
        self.kl_loss_tracker = Mean(name="kl_loss")

        # Encoder
        encoder_inputs = Input(shape=(28, 28, 1))
        encoder_conv = layer_constructor(
            encoder_inputs, name='encoder_conv', filters=32, kernel_size=3, strides=2, advanced_reg=True)
        z_mean = layer_constructor(encoder_conv, name='encoder_mean', units=latent_dim, advanced_reg=True)
        z_log_var = layer_constructor(encoder_conv, name='encoder_log_var', units=latent_dim, advanced_reg=True)
        z = Sampling()([z_mean, z_log_var])
        self.encoder = Model(encoder_inputs, [z_mean, z_log_var, z], name="encoder")

        # Decoder
        latent_inputs = Input(shape=(latent_dim,))
        decoder_outputs = layer_constructor(latent_inputs, name='encoder_dense', units=7 * 7 * 64, advanced_reg=True)
        decoder_outputs = Reshape((7, 7, 64))(decoder_outputs)
        for i, filters, activation in zip([1, 2], [64, 32], ['relu', 'relu']):
            decoder_outputs = layer_constructor(
                decoder_outputs,
                name='decoder_conv', name_ext=str(i), activation=activation, filters=filters, kernel_size=3,
                strides=2, padding='same', conv_transpose=True, advanced_reg=True)
        decoder_outputs = layer_constructor(
            decoder_outputs,
            name='decoder_output', activation='sigmoid', filters=1, kernel_size=3, padding='same',
            conv_transpose=True, advanced_reg=True)
        self.decoder = Model(latent_inputs, decoder_outputs, name="decoder")

More examples

see usage examples in aironsuit/examples

Metadata

Release files for airontools 0.1.8

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

Built distribution (wheel)

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

Release files / airontools-0.1.8-py3-none-any.whl

Download URL airontools-0.1.8-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
430809414867d0b0cfa1b89b7f3dec573d26121c3b5d628442ff9a290049e060
BLAKE2b-256 checksum
How to use checksums
1ca1ee4f0a89c7f7eb356f1da893ab5726ba05871394ac223304efb0f1926e5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5

Security for airontools 0.1.8

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.8 This release

1 release file 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