Last active
February 26, 2018 11:20
-
-
Save crawles/4546865d557dd6f8d998d5e442ee06e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# def ml-engine function | |
submitMLEngineJob() { | |
gcloud ml-engine jobs submit training $JOBNAME \ | |
--package-path=$(pwd)/mnist_classifier/trainer \ | |
--module-name trainer.task \ | |
--region $REGION \ | |
--staging-bucket=gs://$BUCKET \ | |
--scale-tier=BASIC \ | |
--runtime-version=1.4 \ | |
-- \ | |
--outdir $OUTDIR \ | |
--hidden_units $net \ | |
--num_steps 1000 \ | |
$batchNorm | |
} | |
# launch jobs in parallel | |
export PYTHONPATH=${PYTHONPATH}:${PWD}/mnist_classifier | |
for batchNorm in '' '--use_batch_normalization' | |
do | |
net='' | |
for layer in 500 400 300 200 100 50 25; | |
do | |
net=$net$layer | |
netname=${net//,/_}${batchNorm/--use_batch_normalization/_bn} | |
JOBNAME=mnist$netname_$(date -u +%y%m%d_%H%M%S) | |
OUTDIR=gs://${BUCKET}/mnist_models/mnist_model$netname/trained_model | |
echo $OUTDIR $REGION $JOBNAME | |
gsutil -m rm -rf $OUTDIR | |
submitMLEngineJob | |
net=$net, | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment