A model wrapper for automatic model design and visualization purposes.
Project description
AIronSuit
AIronSuit (Beta) is a Python library for automatic model design/selection and visualization purposes built to work with tensorflow (or pytorch in the future) as a backend. It aims to accelerate the development of deep learning approaches for research/development purposes by providing components relying on cutting edge approaches. It is flexible and its components can be replaced by customized ones from the user. The user mostly focuses on defining the input and output, and AIronSuit takes care of its optimal mapping.
Key features:
- Automatic model design/selection with hyperopt.
- Parallel computing for multiple models across multiple GPUs when using a k-fold approach.
- Built-in model trainer that saves training progression to be visualized with TensorBoard.
- Machine learning tools from AIronTools:
net_constructor
,custom_block
,custom_layer
, preprocessing utils, etc. - Flexibility: the user can replace AIronSuit components by a user customized one. For instance, the net constructor can be easily replaced by a user customized one.
Installation
pip install aironsuit
Example
# Databricks notebook source
import numpy as np
from tensorflow import keras
from tensorflow.keras import layers
import os
os.environ['AIRONSUIT_BACKEND'] = 'tensorflow'
from aironsuit.suit import AIronSuit
# COMMAND ----------
# Example Set-Up #
num_classes = 10
input_shape = (28, 28, 1)
batch_size = 128
epochs = 10
# COMMAND ----------
# Load data
(x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data()
# Preprocess data
x_train = np.expand_dims(x_train.astype('float32') / 255, -1)
x_test = np.expand_dims(x_test.astype('float32') / 255, -1)
y_train = keras.utils.to_categorical(y_train, num_classes)
y_test = keras.utils.to_categorical(y_test, num_classes)
# COMMAND ----------
# Create model
model = keras.Sequential([
keras.Input(shape=input_shape),
layers.Conv2D(32, kernel_size=(3, 3), activation='relu'),
layers.MaxPooling2D(pool_size=(2, 2)),
layers.Conv2D(64, kernel_size=(3, 3), activation='relu'),
layers.MaxPooling2D(pool_size=(2, 2)),
layers.Flatten(),
layers.Dropout(0.5),
layers.Dense(num_classes, activation='softmax')])
model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
# COMMAND ----------
# Training
aironsuit = AIronSuit(model=model)
aironsuit.train(
epochs=epochs,
x_train=x_train,
y_train=y_train)
aironsuit.summary()
# COMMAND ----------
# Evaluate
score = aironsuit.evaluate(x_test, y_test)
print('Test loss:', score[0])
print('Test accuracy:', score[1])
More Examples
see usage examples in aironsuit/examples
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for aironsuit-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d967d0c7505507e359bf2d4e9bcfd1d7c92e8cc9f1a56d82ed73cd2d4c777ea5 |
|
MD5 | a29230e758887944c1ffc35e4c5250a3 |
|
BLAKE2b-256 | 2d82401d92dc12693eebabb87813f59b9bd6817ae29e9a68cdff48cf8b026f58 |