2017年4月27日 星期四

[MV] 我心中尚未崩壞的地方

有天發現自己竟然成了片場裡的小丑。 小丑幸運的走上了舞台還發現了光。 但光是短暫會熄滅的,只能不停的尋找更大更亮的光。 小丑找到越來越亮的光,直到被強光灼傷.... 受傷的小丑又找到了一種淡淡的光,卻還是熄滅了。 最後小丑發現其實即使沒有光,只要他想表演,哪裡就是他的舞台。 小丑是在追求光,還是在尋找舞台?

2017年4月19日 星期三

Google Cloud OnBoard 2017 Taipei

Google Cloud Platform

  • Per minute billing
  • Sustain pricing: 25% 自動提供折扣 (20% each 25% usage)
  • Compute Engine: customize CPU and memory (add more memory)
  • Committed discount (1 year or 3 year)
  • CloudNative use cases
  • Free trial 300 USD (1 year valid)

IAM

  • Google Account / Service Account / Google Groups / G suites accounts
  • Organization?

App Engine

  • Similar to AWS BeansTalk or AWS Container Service
  •  Cloud Shell / edit / preview (Very nice integration with browser!!)
  •  Standard environment / Flexible environment (provides ssh)
  •  PaaS, auto scale, container
  • Eclipse wizard integration

Cloud Datastore

  • Similar to AWS DynamoDB?
  • Encryption / Sharding / Replication
  • NoSQL 
  • Auto scaling

Billing

  • Free 28 instance hour? / cost calculator 

Cloud Storage

  • Similar with AWS S3 (bucket / region / storage type by access frequency)
  • < 5TB
  • BLOB
  • GB / per month (granular: minute)
  • Multi Regional 0.026, Regional Nearline(1 time / month)0.01, Coldline (1 time / year) 0.007

Bigtable

  • High loading read/write
  • Cloud Dataflow, Dataproc (Hadoop) integration
  • SunGard, Gmail, Google analytics

Cloud SQL

  • Similar with AWS RDS
  • MySQL 5.5 / 5.6, PostgreSQL (beta)
  • Cloud Spanner
  • Horizontally scalable
  • ACID and SQL queries, High Availability 

GKE: Container Engine

  • Kubernetes
  • Auto scaling / deployment modes (Blue/Green, Rolling Update)
  • kubctl scale / LB / expose …

Compute Engine

  • Similar to AWS EC2 but with additional customization and charging features...
  • Preemptible instance (AWS spot instance?)
  • Add template, group then add group to LB
  • Why keep mentioning pre-warm?

Google Stackdriver

  • Monitor / Trace / Logging / Report / Debugger
  • Fluentd

Lifecycle of Machine Learning model

  • Hosted TensorFlow service (!! AWS ML not provide offline SDK or framework for development)
  • Import / Export model (!! AWS ML not support this)
  • Fasten training time. (with GPU)
  • Data analyze -> clean up
  • Model might not fit the target (Asia 用餐時間 PM7 / 中東 PM9)
  • Linear Regression. Python Pandas, BQ/TnsorFlow => Predict Taxi demand from whether
  • Convolutional Neural Network => Handwriting Recognization

BigQuery

  • Datawarehouse for Analytics
  • Very interesting use case that SQL like query and see results on the fly (query duration)

Datalab

  • For data scientist
  • Very interesting use case!, Wiki style document / run python (panda) and plot chart
  • Average / RMSE 
  • Exploratory plot (whether and taxi trip count)
  • CNN => signature
  • 3 demos
  • Classification => drawing
  • Prediction => Whether and taxi trips
  • Convolution Neural Network => Handwriting reconization

Summary

  • Very similar with part of AWS services, but AWS has more complete coverage and use cases.
  • Machine Learning allow export model and based on open source TensorFlow framework
  • Billing is more flexible than AWS
  • Seems more emphasis on container use cases
  • Some special database storage, such as Cloud Spanner and BigTable, BigQuery....
  • The browser integration and UX is quite geek and interesting. (Datalab / BigQuery / Cloud Shell / Cloud Preview / In browser edit ...etc...)

References

2017年4月10日 星期一

AWS Machine Learning Workshop


Machine Learning Concepts

  • Apply AWS ML to problems you have existing samples of actual answers
  • For example, to predict if new email is spam or not, you need to collect examples of spam and non-spam.
  • Binary classification (true / false)
  • Is spam or not spam, churn, will customer accept campaign?
  • Multiclass classification (one of more than two outcomes)
  • Regression (numeric number)
  • Building a Machine Learning Application
  • Frame the core ML problems
  • Collect, clean and prepare data
  • Features from raw data
  • Feed to learning algorithm to build models
  • Use the model to generate predictions for new data

Linear Models

  • Leaning process computes one weight for each feature to form a model that can predict the target value
  • For example, estimated target = 0.2 + 5 * age + 0.00003 * income

Learning Algorithm

  • Learn the weights of the model
  • Loss function: penalty when estimate target provide by the model not equal exact result
  • Optimization technique: minimize the loss (Stochastic Gradient Descent), during each passes updates the feature weights one example at a time with the aim of approaching the optimal weight that minimize the loss.
  • For binary classification, Amazon ML uses logistic regression (logistic loss function + SGD).
  • For multiclass classification, Amazon ML uses multinomial logistic regression (multinomial logistic loss + SGD).
  • For regression, Amazon ML uses linear regression (squared loss function + SGD)

Evaluate Model Accuracy

  • 70% to build up model, 30% for evaluation
  • Binary classification, 0.5 almost same use random guessing

Workshop

  • Download samples from  http://bit.ly/john-2017ml-labdata, create a S3 bucket and upload 3 csv files into that S3 bucket.
  • churn_new.csv => create data source from s3 file link => create model => use custom receipt
  • With 3334 records has column "State,Account Length,Area Code,Phone,Intl Plan, VMail Plan, VMail Message, Day Mins,Day Calls,Day Charge,Eve Mins,Eve Calls,Eve Charge,Night Mins,Night Calls,Night Charge,Intl Mins,Intl Calls,Intl Charge,CustServ Calls,Churn?", once you import them into AWS ML, you will automatically have a model used to predict a customer will leave or continue subscription.
  • 70% of imported data will be used to build up model, 30% will be used to evaluate the accuracy of the model.
  • banking.csv => create data source from s3 file link => create model => use default 
  • banking-batch.csv => create batch prediction from model above 

Thoughts

  • This 3 hour workshop is easy and help you have basic understanding how to use AWS Machine Learning service to automatically create Model, evaluate Model and call API for prediction.
  • Prepare your data to CSV format and upload to S3, then rest of modeling part and evaluation result AWS will create for you.
  • There are also other sources for you to import real production data such as RDS / RedShift ...etc...
  • The visualization is easy for you to evaluate the model
  • There are APIs for you to do prediction based on your created models.
  • Batch prediction
  • Real time prediction
  • The hardest part is "How to prepare your data and feature from raw data?"
  • The AWS Machine Learning document is worth to read! You can have basic understanding of Machine Learning concepts and how AWS did internally.

References