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
/*============================================================================== | |
Copyright (c) 2017 PTC Inc. All Rights Reserved. | |
Copyright (c) 2010-2014 Qualcomm Connected Experiences, Inc. | |
All Rights Reserved. | |
Confidential and Proprietary - Protected under copyright and other laws. | |
==============================================================================*/ | |
using UnityEngine; | |
using Vuforia; |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class RotateEarth : MonoBehaviour { | |
// Use this for initialization | |
void Start () { | |
} | |
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 generate_estimator(output_dir): | |
return tf.estimator.DNNRegressor(feature_columns=feature_cols, | |
hidden_units=[10, 10], | |
model_dir=output_dir) |
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 generate_input_fn(data_set): | |
def input_fn(): | |
features = {k: tf.constant(data_set[k].values) for k in FEATURES} | |
labels = tf.constant(data_set[LABEL].values) | |
return features, labels | |
return input_fn |
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 serving_input_fn(): | |
#feature_placeholders are what the caller of the predict() method will have to provide | |
feature_placeholders = { | |
column.name: tf.placeholder(column.dtype, [None]) | |
for column in feature_cols | |
} | |
#features are what we actually pass to the estimator | |
features = { | |
# Inputs are rank 1 so that we can provide scalars to the server |
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
train_spec = tf.estimator.TrainSpec( | |
input_fn=generate_input_fn(data_train), | |
max_steps=3000) | |
exporter = tf.estimator.LatestExporter('Servo', serving_input_fn) | |
eval_spec=tf.estimator.EvalSpec( | |
input_fn=generate_input_fn(data_test), | |
steps=1, | |
exporters=exporter) |
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
%%bash | |
mkdir trainer | |
touch trainer/__init__.py |
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
%%writefile trainer/task.py | |
import argparse | |
import pandas as pd | |
import tensorflow as tf | |
from tensorflow.contrib.learn.python.learn import learn_runner | |
from tensorflow.contrib.learn.python.learn.utils import saved_model_export_utils | |
print(tf.__version__) | |
tf.logging.set_verbosity(tf.logging.ERROR) |
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
GCS_BUCKET = 'gs://BUCKET_NAME' #غير هذه الى اسم البكت الخاصة بك CHANGE THIS TO YOUR BUCKET | |
PROJECT = 'PROJECT_ID' #غير هذا الى اسم المشروع الخاص بك CHANGE THIS TO YOUR PROJECT ID | |
REGION = 'us-central1' #اختياري ماهي المنطقة OPTIONALLY CHANGE THIS |
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
%%bash | |
gcloud ai-platform local train \ | |
--module-name=trainer.task \ | |
--package-path=trainer \ | |
-- \ | |
--output_dir='./output' |
OlderNewer