Skip to content

Latest commit

 

History

History

gan

Train a custom GAN model

Goal

As part of this repo, you will learn to build a custom GAN architecture and train the model using Amazon SageMaker.

Prerequisites

  • Access to Amazon SageMaker

Cost

Using a ml.c5.4xlarge, the entire exercise take 3-4 hrs to run. Please see the Amazon SageMaker pricing for details.

Setup

First we create the Amazon SageMaker notebook instance.

Navigate to Amazon SageMaker using the link: https://console.aws.amazon.com/sagemaker/home?region=us-east-1#/dashboard

notebook-instance

Click Notebook instances from the left navigation bar

Select Create notebook instance

create-notebook

Within the notebook instance creation form, select "c5.4xlarge" for Notebook instance type

notebook-instance-settings

Set the following for Permissions and encryption:

  • IAM role: Use an existing role or create a new role
  • Root access: Enable
  • Encryption key: No Custom Encryption

notebook-instance-settings

Set the following for Git repositories:

notebook-instance-settings

Click Open Jupyter

open-notebook

Click gan folder, then click GAN.ipynb

GAN-notebook

You will likely be prompted to select kernel. Choose the drop down and select conda_python3 as the kernel

set-kernel

This notebook contains instructions and code to create a custom GAN model from scratch. Follow the notebook content and run all cells to the end.

run-notebook

To run the code cells, choose the code cell you want to run and click Run

kernel-empty

If the kernel has an empty circle, it means it is free and ready to execute the code

kernel-busy

If the kernel has a filled circle, it means it is busy. Wait for it to become free before you execute the next line of code.

Next Steps

Congratulations on building a custom GAN model from scratch!

Now try using your model to create compositions based on your custom MIDI input.

Important: Remember to stop your Amazon SageMaker instances after you're done to avoid extra charges

notebook-stop