Giter Club home page Giter Club logo

sagemaker-documentdb-train-gnn-for-millions-proteins's Introduction

sagemaker-documentdb-train-gnn-for-millions-proteins

Codes for AWS ML blog post entitled "Training graph neural nets for millions of proteins on Amazon SageMaker and DocumentDB (with MongoDB compatibility)"

Instructions

1. Creating resources

We have prepared the following AWS CloudFormation template to create the required AWS resources for this post. For instructions on creating a CloudFormation stack, see the video Simplify your Infrastructure Management using AWS CloudFormation. The CloudFormation stack provisions the following:

  • A VPC with three private subnets for DocumentDB and two public subnets intended for SageMaker Notebook instance and ML training containers, respectively.
  • An Amazon DocumentDB cluster with three nodes, one in each private subnet.
  • An AWS Secrets Manager secret to store login credentials for Amazon DocumentDB. This allows us to avoid storing plaintext credentials in our SageMaker instance.
  • A SageMaker Notebook instance to prepare data, orchestrate training jobs, and run interactive analyses.

In creating the CloudFormation stack, you need to specify the following:

  • Name for your CloudFormation stack
  • Amazon DocumentDB username and password (to be stored in Secrets Manager)
  • Amazon DocumentDB instance type (default db.r5.large)
  • SageMaker instance type (default ml.t3.xlarge) It should take about 15 minutes to create the CloudFormation stack.

2. Prepare protein structures and properties and ingest the data into DocumentDB

The notebook Prepare_data.ipynb handles data preprocessing and ingestion to DocumentDB. This notebook runs in the conda_pytorch_latest_p36 environment that comes with Sagemaker. If you prefer setting up your own python environment, you can do so by:

# set up virtual environment:
$ python3 -m venv venv
$ source venv/bin/activate
# install dependencies:
$ pip install -r requirements.txt

3. Train a GNN on the protein structures using SageMaker

The notebook [Train_and_eval.ipynb] first trains a GNN model on the protein structure datasets stored in the DocumentDB; then loads and evaluates the trained GNN model.

4. Cleaning up

To avoid incurring future charges, delete the CloudFormation stack you created. This removes all the resources you provisioned using the CloudFormation template, including the VPC, Amazon DocumentDB cluster, and SageMaker instance. For instructions, see Deleting a stack on the AWS CloudFormation console.

Security

See CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.

sagemaker-documentdb-train-gnn-for-millions-proteins's People

Contributors

amazon-auto avatar wangz10 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.