Opinionated machine learning organization and configuration
Project description
microcosm-sagemaker
Opinionated machine learning with SageMaker
Usage
After creating a new model, there are a few steps to integrate with microcosm-sagemaker.
-
Create a training graph
The training graph holds the dependencies that are required at train time. These typically include the bundles you have defined or any related helper functions.
from microcosm_sagemaker.loaders import load_train_conventions def create_app(debug=False, testing=False): config_loader = load_each( load_from_environ, load_train_conventions, ) graph = create_object_graph( name="my model", ) graph.use( "active_bundle", "my_primary_bundle", ) return graph.lock()
-
Create a service graph.
The service graph holds the dependencies that are required at service time. These typically include Flask and the web service routes.
from microcosm_sagemaker.loaders import load_model_artifact_config def create_app(artifact_path, debug=False, testing=False, model_only=False): loader = load_each( load_model_artifact_config(artifact_path), ) graph = create_object_graph( name="my model", ) graph.use( "active_bundle", "active_evaluation", ) if not model_only: graph.use( "my_primary_bundle", "my_primary_evaluator", ) return graph.lock()
-
Expose the graphs in
setup.py
.setup( name="my_model", entry_points={ "microcosm_sagemaker.app_hooks": [ "train = my_model.train.app:create_app", "serve = my_model.serve.app:create_app", ], }, )
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 Distribution
microcosm-sagemaker-0.2.1.tar.gz
(16.0 kB
view hashes)
Close
Hashes for microcosm-sagemaker-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa22d5692e275272af4c9a3f33dff27c42c3f28ae5d3d583d96a9d0707572158 |
|
MD5 | 599a2f0bdae7a77adcd720bfdd462c9b |
|
BLAKE2b-256 | 7c36f8efda9f7e09b1a88b6dff0dcc587def459c47fec8d7c7ee170a349a0073 |