aisquared.config package

Subpackages

Submodules

aisquared.config.CustomObject module

class aisquared.config.CustomObject.CustomObject(class_name: str, top_level_kwargs: dict | None = None, **kwargs)[source]

Bases: BaseObject

Custom class that allows the user to define custom classes for configuration

Example usage:

>>> import aisquared
>>> my_obj = aisquared.base.CustomObject(
    'MyClass',
    key1 = 'foo',
    key2 = 'bar'
    )
>>> my_obj.to_dict()
{'className': 'MyClass', 'params': {'key1': 'foo', 'key2': 'bar'}}
)
to_dict() dict[source]

Get the object as a dictionary

aisquared.config.GraphConfiguration module

class aisquared.config.GraphConfiguration.GraphConfiguration(name: str, stage: str = 'experimental', version: int | None = None, description: str = '', mlflow_uri: str | None = None, mlflow_user: str | None = None, mlflow_token: str | None = None, owner: str | None = None, url: str = '*', auto_run: bool = False, documentation_link: str = '')[source]

Bases: BaseObject

Configuration object for deploying a set of processing steps and/or analytics as a dependency graph

add_node(step: BaseObject, dependencies: int | list | None = None) int[source]

Add a node to the configuration graph

Parameters:
  • step (aisquared configuration step) – The step to add

  • dependencies (int, list of int, or None) – The ids of nodes which must be run before the added node

Returns:

node_id – The integer id of the node that is added

Return type:

int

property auto_run
compile(filename: str | None = None, dtype: str | None = None) None[source]

Compile the object into a ‘.air’ file, which can then be dragged and dropped into applications using the AI Squared JavaScript SDK

Parameters:
  • filename (path-like or None (default None)) – Filename to compile to. If None, defaults to ‘{NAME}.air’, where {NAME} is the name of the analytic

  • dtype (str or None (default None)) – The datatype to use for the model weights when using a Keras model. If None, defaults to ‘float32’

property description
get_filenames() list[source]

Get filenames for all models in the configuration

property mlflow_token
property mlflow_uri
property mlflow_user
property name
property owner
property stage
to_dict() dict[source]

Get the object as a dictionary

property url
property version

aisquared.config.ModelConfiguration module

class aisquared.config.ModelConfiguration.ModelConfiguration(name: str, harvesting_steps: BaseObject | list | None = None, preprocessing_steps: BaseObject | list | None = None, analytic: BaseObject | list | None = None, postprocessing_steps: BaseObject | list | None = None, rendering_steps: BaseObject | list | None = None, feedback_steps: BaseObject | list | None = None, stage: str = 'experimental', version: int | None = None, description: str = '', mlflow_uri: str | None = None, mlflow_user: str | None = None, mlflow_token: str | None = None, owner: str | None = None, url: str = '*', auto_run: bool = False, documentation_link: str = '', warnings: list | None = None)[source]

Bases: BaseObject

Configuration object for deploying a model or analytic

property analytic
property analytic_dict
property auto_run
compile(filename: str | None = None, dtype: str | None = None) None[source]

Compile the object into a ‘.air’ file, which can then be dragged and dropped into applications using the AI Squared JavaScript SDK

Parameters:
  • filename (path-like or None (default None)) – Filename to compile to. If None, defaults to ‘{NAME}.air’, where {NAME} is the name of the analytic

  • dtype (str or None (default None)) – The datatype to use for the model weights. If None, defaults to ‘float32’

property description
property feedback_dict
property feedback_steps
get_model_filenames() list[source]

Get filenames for all models in the configuration

property harvester_dict
property harvesting_steps
property mlflow_token
property mlflow_uri
property mlflow_user
property name
property owner
property postprocesser_dict
property postprocessing_steps
property preprocesser_dict
property preprocessing_steps
property render_dict
property rendering_steps
property stage
to_dict() dict[source]

Get the object as a dictionary

property url
property version
property warnings

Module contents

The aisquared.config subpackage contains utilities and objects for packaging aisquared configuration steps and models.

For in-depth examples of how to build out .air files using the utilities and classes in this library, please visit our GitHub repository at https://github.com/AISquaredInc/airFiles