GPUメーカー

大手GPUメーカー
– Nvidia
– Intel
– AMD

まずNvidia

やべーなこれ、日本は全く相手にされてないな。

What we need to see:

BS or MS in Computer Science or equivalent program from an accredited University / College
10+ years of hands-on experiences building software and/or scalable cloud services
Strong self-initiative, passion, interpersonal skills, and agility working with new technology
Hands-on development of high quality distributed system features and/or cloud scale services, and RESTful web services
Experience with cloud system infrastructure, cloud-scale software, Continuous Integration and Continuous Delivery (CI/CD)
Demonstrated skills in wide variety of languages including: Java and Python
Deep understanding of cloud design in the areas of virtualization and global infrastructure, distributed systems, load balancing and security
Track record of crafting well-designed solutions and delivering high-quality software on time

Intel

AMD
REQUIREMENTS:

Advanced programming skills in C for operating system kernel & systems development
Experience with the GNU toolchain
Proficient use of git
Experience building and submitting patches on a mailing list and in general collaborative open source development
Excellent understanding of operating systems concepts, data structures, the x86-64 architecture, and virtualization
Experience with low level debug tools as well as emulators and simulators
Experience with open source software development
Experience working with external software partners
Experience running, analyzing, and tuning system performance benchmarks
Strong analysis and problem solving skills
Proven interpersonal skills, technical and team leadership and collaboration
Excellent written and verbal communication skills
Programming skills with Python and Bash
Preferred experience with Jenkins for CI/CT.

やべーなこれ。。

Azureのmachine learning

Microsoftの機械学習はどんな感じでしょうか?

– Bach AI
– Bot Service
– Cognitive Services
– Machine Learning service workspaces
– Machine Learning Studio web services
– Machine Learning Studio workspaces
– Genomics accounts
– Machine Learning Studio web service plan

Machine Learning Studio web services
必要なデータ、フィルタ、計算モデル等のロジックをドラック&ドロップで配置する

ん、ちょっと待てよ
Mean Absolute Error
Root Mean Squared Error
Relative Absolute Error
Relative Squared Error
Coefficient of Determination

これは別に機械学習でもなんでもないように思うんだが。。

GCPの機械学習サービス

どんなものがあるか見てみましょう

データラベル付け
AIプラットフォーム
Natural Language
テーブル
Talent Solution
翻訳
Vision
Video Intelligence

うーん、tutorialでもGCPだと金がかかりそうだなー
その前に、tensor flowを理解しろ、って言ってるな。
https://cloud.google.com/ml-engine/docs/tensorflow/getting-started-training-prediction

なんかやること多すぎないか。。

AWSの機械学習サービス

ざっと見ただけでも色々ありそうだ

Amazon SageMaker:データサイエンティスト、機械学習エンジニア向け
Amazon Comprehend:自然言語処理
AWS DeepLens
Amazon Lex:会話型インターフェイス、チャットボット
Machine Learning:線形回帰、ロジスティック回帰、多項ロジスティック回帰
Amazon Polly:テキストを音声変換
Rekognition:画像や動画を用意するだけで検出
Amazon Transcribe:文字起こしサービス
Amazon Translate
Amazon Personalize:パーソナライズ、レコメンデーション
Amazon Forecast:時系列予想
Amazon Textract:書類からテキストの抽出
AWS DeepRacer:自律走行

1.予測のみ行うサービス:Transcribe, Polly
2.ユーザーは学習データのみ用意し、サービス側でモデルをトレーニング:Comprehend, Machine Learning
3.インフラを気にせずモデルのトレーニング/評価/デプロイ:SageMaker

1と2は機械学習の知識がなくても利用できる。3はインフラ管理が減る。
つまり、AWSで機械学習サービスをやるならsageMakerってところか。。

amazon recognitionはサービスへの導入が比較的イメージしやすいかも。使ってみたい。

Laravelでseederを使おう

まず、seeder fileを作ります。

[vagrant@localhost test]$ php artisan make:seeder SmartTableSeeder
Seeder created successfully.

すると、database/seeds配下に SmartTableSeeder.php が出来る。

runメソッドでデータ挿入

use Illuminate\Database\Seeder;

class SmartTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $ministers = ['taro', 'masatoshi', 'takashi','masahiko','takumi'];
        foreach ($ministers as $minister) {
        	DB::table('minister')->('minister')
        }
    }
}

あれ、DB::table(‘minister’)->(‘minister’) って、なんかおかしいぞ。
で、シーダーファイルは、DatabaseSeeder.phpから呼び出す。

use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // $this->call(UsersTableSeeder::class);
        $this->call('SmartTableSeeder::class');
    }
}

seeder 実行
[vagrant@localhost test]$ php artisan db:seed
Seeding: SmartTableSeeder::class

In Container.php line 729:

Class SmartTableSeeder::class does not exist

ん?
[vagrant@localhost test]$ php composer.phar dump-autoload
Generating optimized autoload filesCarbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
You can run ‘./vendor/bin/upgrade-carbon’ to get help in updating carbon and other frameworks and libraries that depend on it.
Generated optimized autoload files containing 3116 classes
[vagrant@localhost test]$ php artisan db:seed
Seeding: SmartTableSeeder::class

In Container.php line 729:

Class SmartTableSeeder::class does not exist

あれええええええー

あ、こうか

use Illuminate\Database\Seeder;


class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // $this->call(UsersTableSeeder::class);
        $this->call(
        	SmartTableSeeder::class
        );
    }
}

[vagrant@localhost test]$ php artisan db:seed
Seeding: SmartTableSeeder

In Connection.php line 647:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘test.minister’ d
oesn’t exist (SQL: insert into `minister` (`age`, `name`) values (54, taro)
, (54, taro))

In Connection.php line 445:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘test.minister’ d
oesn’t exist

うん、seederが複数あるときと、一つの場合だと書き方が異なりますね。
migrationしてないので、カラムが無いと表示されていますが、seederについてはわかりました。

AWS AMI

AMIは”Amazon Machine Image”の略。
AMIはインスタンスのルートボリュームのテンプレートが含まれ、インスタンスの丸ごとバックアップが取れる。

EC2のイメージの作成からAMIを作成する

AMIをローンチすると、EC2が立ち上がる。
なるほど、これは凄い便利ですねー

Amazon Elastic Container Service(ECS)って何?

何やらECSを知ってないと駄目らしい。
ECSって何?英会話教室? あ、それECCね。

ECSはAmazon Elastic Container Serviceの略。
クラスターでDockerコンテナを簡単に実行、停止、管理できるコンテナ管理サービス。
あれ、Dockerのデプロイならk8sじゃなかったっけ??

まず公式から。
https://docs.aws.amazon.com/ja_jp/AmazonECS/latest/developerguide/Welcome.html

ロードバランサのポートマッピングやコンテナの生死監視、自動復旧などをやってくれるのね。

やってるのは、ecs-agentというのをコンテナとして起動して、confにcluster名を渡してあげているだけとのこと。

autoscaling groupを使ってインスタンスを立てて、その起動スクリプトでacs-agentを動かす。

ecsのクラスターの作成

まあ、dockerでサービスやるなら、ってところか。

機械学習のモデル精度

機械学習の予想値と正解のずれを測る
学習データから一部のデータをテストデータとして取り分けておく
テストデータにモデルを適用した場合の精度を評価する

ハイパーパラメータの調整も視野に入れる
「学習用」「検証用」「テスト用」の3つに分割する

分類・・・どれくらいラベルが正しく識別できたか、Accuracy
回帰・・・正解の値と予想の値のズレがどれくらい少ないか、RMSE(Root Mean Squared Error) 予想値が実測値から平均してどれくらいズレているか、RMAE(Root Mean Absolute Error)

正解がわかっているデータ → テスト用データ、学習用データ → 学習済みモデルの適用 → 識別、予測精度

過学習
→ 過学習が起きた時は、ハイパーパラメータを調整する

精度が落ちてきた場合
→ データの追加(データ追加、説明変数変更など)、前処理の調整(異常値処理)、モデルの調整(単純なモデルより複雑なモデルの方が精度が向上する)

ディープラーニングの基礎

ニューラルネットワークとは
-> ニューロンに該当する多数のユニットから構成
-> 各ユニットは入力に対して、ユニット間の重みを加味した非線形な演算を行った結果を出力する
「入力層」→「中間層1層」→「出力層」

ディープラーニングとは
-> ニューラルネットワークの層を多数重ねたもの
「入力層」→「中間層3層」→「出力層」
-> ディープラーニングでは、バックプロパケーションと呼ばれるアルゴリズムを使用し、誤差が段々と少なくなるよう重みを調整

ディープラーニングのモデル
Deep Neural Network: DNN
→ ニューラルネットワークの層を多層にしたモデル
AutoEncoder
→ 出力と入力が一致
Convolutional Neural Network
→ 主に画像解析に用いられるモデル
Recurrent Neural Network
→ 主にテキスト解析や時系列解析に用いられる

機械学習のモデル構築の用語

識別や予測を行う対象の変数:目的変数
識別や予測を行うための変数:説明変数

予想売り上げ = a x 気温 + b x 湿度 + 定数

機械学習アルゴリズムを適用可能な形式にデータ加工する処理:前処理
モデルの確認:検証

行と列を持つ表形式のデータ:構造化データ
画像、テキスト、音声:非構造化データ

構造化データの「行」:事例
構造化データの「列」:特徴量
構造化データ:データフォーマット

データを前処理で加工して、データフォーマットに直して、モデルを構築。識別、予測結果を評価する。

画像データの場合は、ピクセルのRGBデータを全て処理して行く

画像認識のタスク分類
– 画像分類、物体検出、シーン理解 
→自動運転はシーン理解までやってる?

自然言語処理
→ 形態素分析

音声データ
→ フーリエ変換を用いて、周波数ごとの特徴に変換する
→ MFCC

機械学習は前処理の工数がもっともかかることが多い