用 Machine Learning 調校資料庫

AWS AI Blog 在月初上放出來的消息:「Tuning Your DBMS Automatically with Machine Learning」。

Carnegie Mellon Database Group 做的研究,除了預設值以外,另外跟四種不同的參數做比較,分別是 OtterTune (也就是這次的研究)、Tuning script (對於不熟資料庫的人,常用的 open source 工具)、DBA 手動調整,以及 RDS

MySQL

PostgreSQL

比較明顯的結論是:

  • Default 值在所有的 case 下都是最差的 (無論是 MySQL 與 PostgreSQL 平台,以及包括 99% 的 Latency 與 QPS,這樣二乘二的四個結果)。而且 Default 跑出來的數字與其他的差距都很明顯。
  • OtterTune 在所有 case 下跑出來都比 Tuning script 的好。這也是合理的結果,本來就是想要取代其他機器跑出來的結果。

至於有些討論 DBA 會失業的事情,我是樂見其成啦... 這些繁瑣的事情可以自動化就想交給自動化吧 XD

Google Cloud Platform 的機器與服務也支援 GPU 了...

Google 宣佈在 GCP 上的機器與服務支援 GPU 運算了:「GPUs are now available for Google Compute Engine and Cloud Machine Learning」。

算是 beta 階段,用的是 NVIDIA Tesla K80

Google Cloud Platform gets a performance boost today with the much anticipated public beta of NVIDIA Tesla K80 GPUs.

然後台灣的 asia-east1 也在內。第一波必須透過 cli 操作,之後才會在 web console 上加上去:

You can now spin up NVIDIA GPU-based VMs in three GCP regions: us-east1, asia-east1 and europe-west1, using the gcloud command-line tool. Support for creating GPU VMs using the Cloud Console appears next week.

也開始支援 GPU 了...

把才能用在奇怪的地方:老闆偵測器

作者用 OpenCV 學習老闆的臉,然後當老闆走過來的時候把畫面切到努力工作中的 screenshot XDDD:「Deep Learning Enables You to Hide Screen when Your Boss is Approaching」。

“My boss left his seat and he was approaching to my seat.”

“OpenCV has detected the face and input the image into the learned model.”

“The screen has switched by recognizing him! ヽ(‘ ∇‘ )ノ ワーイ”

作者是個日本人 (要說不意外嗎 XDDD),這套軟體的程式碼在「Hironsan/BossSensor」這邊 XDDD

超級浪費才能 XDDD

Amazon Rekognition:圖片辨識 API

GoogleVision API,到 MicrosoftComputer Vision API (參考「微軟也推出圖片辨識的 API 了」),AWS 也推出類似的服務了:「Amazon Rekognition – Image Detection and Recognition Powered by Deep Learning」。

與其他兩家都是類似的方式,丟圖進去然後用系統已經 train 好的資料給你分析結果... 然後依照次數算錢。

有種算是補產品線的感覺啦...

Yahoo! 也放出了判斷是否為色情圖片的方案

感覺好像是從 AlphaGo 大勝李世乭開始,透過各類 neural network 的技術就一直冒出來...

Yahoo! 這次放出來判斷是否為色情圖片的也是同源的技術:「Open Sourcing a Deep Learning Solution for Detecting NSFW Images」。

當年沒辦法做的事情,現在的技術已經成熟到被 open source 出來了...

Google 整理並公開出九百萬張圖片以及對應的 tag

Google 放出了九百萬張以 CC 授權釋出的圖片,標上 tag 後變成 Open Images dataset:「Introducing the Open Images Dataset」,像是這樣:

Annotated images form the Open Images dataset. Left: Ghost Arches by Kevin Krejci. Right: Some Silverware by J B. Both images used under CC BY 2.0 license

不過這不是人類分類出來的結果,而是機械學習的成果:

The image-level annotations have been populated automatically with a vision model similar to Google Cloud Vision API.

不過因為這不是人工確認過的資料,如果要拿來做比較精確的研究,還是得用 Amazon Mechanical Turk 這類服務先校正過以確保正確性。

Amazon EC2 的 P2 instance

Amazon EC2 為了 GPU 而推出的 P2 type:「New P2 Instance Type for Amazon EC2 – Up to 16 GPUs」。

p2.large 有這樣的規格:

This new instance type incorporates up to 8 NVIDIA Tesla K80 Accelerators, each running a pair of NVIDIA GK210 GPUs. Each GPU provides 12 GB of memory (accessible via 240 GB/second of memory bandwidth), and 2,496 parallel processing cores.

而最大台的 p2.16xlarge 也就是 16 倍... 每小時單價也刷新了之前 x1.32xlarge 的記錄 $13.338/hr (us-east-1),來到了 $14.4/hr...

另外也推出了 deep learning AMI,內裝了一堆常見支援 GPU 的 ML framework:

In order to help you to make great use of one or more P2 instances, we are launching a Deep Learning AMI today.

透過演算法修照片的工具

看到「A simple interface for editing natural photos with generative neural networks.」這個工具,直接看這個兩分鐘的影片比較清楚知道他想要做的事情:

當你修正了某一個點後,這個工具就透過演算法改變其他的點,讓照片看起來變得自然... 作者所發表的論文可以在「Neural Photo Editing with Introspective Adversarial Networks」這邊下載到。

透過 Deep Learning 辨識人臉馬賽克的技術

在某些新聞報導透漏出了受害者的某些背景身份,於是你手上有了這兩個資料:

  • 符合這些背景身份的四十個人的照片。
  • 人臉被馬賽克後的新聞照片。

現在的問題是,要怎麼判斷出新聞照片裡是哪個人:「Defeating Image Obfuscation with Deep Learning」。

類似這樣的實驗,從 40 個人中找出正確的人,有 50% 的正確率:

也許 50% 不算到能用的程度,但這代表老大哥的技術已經在發展了...

機器學習減肥法

Hacker News Daily 上看到的方法,作者利用機器學習的方法試著找出那些因素導致他變胖,然後再規劃減肥計畫:「Discovering ketosis: how to effectively lose weight」,文章有點長,講重點。

首先作者把每天的體重與行為記錄起來,像是這樣:

#
# -- Comment lines (ignored)
#
Date,MorningWeight,YesterdayFactors
2012-06-10,185.0,
2012-06-11,182.6,salad sleep bacon cheese tea halfnhalf icecream
2012-06-12,181.0,sleep egg
2012-06-13,183.6,mottsfruitsnack:2 pizza:0.5 bread:0.5 date:3 dietsnapple splenda milk nosleep
2012-06-14,183.6,coffeecandy:2 egg mayo cheese:2 rice meat bread:0.5 peanut:0.4
2012-06-15,183.4,meat sugarlesscandy salad cherry:4 bread:0 dietsnapple:0.5 egg mayo oliveoil
2012-06-16,183.6,caprise bread grape:0.2 pasadena sugaryogurt dietsnapple:0.5 peanut:0.4 hotdog
2012-06-17,182.6,grape meat pistachio:5 peanut:5 cheese sorbet:5 orangejuice:2
# and so on ...

當時只是記錄,並沒有刻意減肥:

I was not dieting at that time. Just collecting data.

剩下的就跑分析直接拉出哪些行為的幫助最大,於是就有這張圖了: