Skip to content

Instantly share code, notes, and snippets.

@leechanwoo
leechanwoo / datalab1.sh
Last active August 21, 2017 14:48
datalab create step 1
datalab create instance_name --machine-type=f1-micro
@leechanwoo
leechanwoo / datalab_connect.sh
Created August 21, 2017 15:55
datalab connect
datalab connect instance_name
@leechanwoo
leechanwoo / simple_code.py
Created August 21, 2017 17:26
hello tensorflow
import tensorflow as tf
const = tf.constant("hello tensorflow")
with tf.Session() as sess:
result = sess.run(const)
print(result)
@leechanwoo
leechanwoo / simple_code.py
Created August 21, 2017 17:31
simple code in datalab
%writefile ./package/simple_code.py
import tensorflow as tf
const = tf.constant("hello tensorflow")
with tf.Session() as sess:
result = sess.run(const)
print(result)
@leechanwoo
leechanwoo / job_submit.sh
Created August 21, 2017 17:44
shell command for ml engine
%bash
gcloud ml-engine jobs submit training first_job_submit \
--module-name=package.simple_code \
--package-path=$(pwd)/package \
--region=us-east1 \
--staging-bucket=gs://tensorflowprojects-mlengine \
@leechanwoo
leechanwoo / simple_neuralnet.py
Last active August 21, 2017 18:57
simple nn
%writefile ./package/simple_neuralnet.py
import tensorflow as tf
up = [i for i in range(10)]
down = [9-i for i in range(10)]
x = tf.constant([up if i%2 == 0 else down for i in range(1000)], tf.float32)
y_ = tf.constant([[1] if i%2 == 0 else [0] for i in range(1000)], tf.float32)
layer1 = tf.layers.dense(x, 10)
@leechanwoo
leechanwoo / gist:750a03e9d7ccc1a164c19b890a4ba71d
Created August 21, 2017 18:58
simple neural net job submit
gcloud ml-engine jobs submit training simple_neuralnet \
--module-name=package.simple_neuralnet \
--package-path=$(pwd)/package \
--region=us-east1 \
--staging-bucket=gs://tensorflowprojects-mlengine
@leechanwoo
leechanwoo / basic_gpu.sh
Created August 21, 2017 19:06
job submit BASIC_GPU
gcloud ml-engine jobs submit training simple_neuralnet_gpu \
--module-name=package.simple_neuralnet \
--package-path=$(pwd)/package \
--region=us-east1 \
--staging-bucket=gs://tensorflowprojects-mlengine \
--scale-tier=BASIC_GPU
@leechanwoo
leechanwoo / config_4gpu.yaml
Last active August 21, 2017 19:28
4 gpu custom set
%writefile ./config.yaml
trainingInput:
masterType: complex_model_m_gpu
@leechanwoo
leechanwoo / 8gpu.sh
Created August 21, 2017 19:19
simple neural net 8gpu
gcloud ml-engine jobs submit training simple_neuralnet_8gpu \
--module-name=package.simple_neuralnet \
--package-path=$(pwd)/package \
--region=us-east1 \
--staging-bucket=gs://tensorflowprojects-mlengine \
--scale-tier=CUSTOM \
--config=./config.yaml