機械学習の社会実装では、予測精度が高くても、機械学習がブラックボックであるために使うことができないということがよく起きます。
このスライドでは機械学習が不得意な予測結果の根拠を示すために考案されたLIMEの論文を解説します。
Ribeiro, Marco Tulio, Sameer Singh, and Carlos Guestrin. "" Why should i trust you?" Explaining the predictions of any classifier." Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining. 2016.
In this work, we introduce a new Markov operator associated with a digraph, which we refer to as a nonlinear Laplacian. Unlike previous Laplacians for digraphs, the nonlinear Laplacian does not rely on the stationary distribution of the random walk process and is well defined on digraphs that are not strongly connected. We show that the nonlinear Laplacian has nontrivial eigenvalues and give a Cheeger-like inequality, which relates the conductance of a digraph and the smallest non-zero eigenvalue of its nonlinear Laplacian. Finally, we apply the nonlinear Laplacian to the analysis of real-world networks and obtain encouraging results.
機械学習の社会実装では、予測精度が高くても、機械学習がブラックボックであるために使うことができないということがよく起きます。
このスライドでは機械学習が不得意な予測結果の根拠を示すために考案されたLIMEの論文を解説します。
Ribeiro, Marco Tulio, Sameer Singh, and Carlos Guestrin. "" Why should i trust you?" Explaining the predictions of any classifier." Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining. 2016.
In this work, we introduce a new Markov operator associated with a digraph, which we refer to as a nonlinear Laplacian. Unlike previous Laplacians for digraphs, the nonlinear Laplacian does not rely on the stationary distribution of the random walk process and is well defined on digraphs that are not strongly connected. We show that the nonlinear Laplacian has nontrivial eigenvalues and give a Cheeger-like inequality, which relates the conductance of a digraph and the smallest non-zero eigenvalue of its nonlinear Laplacian. Finally, we apply the nonlinear Laplacian to the analysis of real-world networks and obtain encouraging results.
38. 生成モデルについて
Transformerの構造③ • デコーダ
→ Attention層で重み付けして来たものに対して、最
終的にどういう出力がいいか判断して、出力する。
Self-Attention層(マスクあり)
入力文章内の照応関係(類似度や重要度)を獲得する層。
Positional Encoding層
単語の位置情報を埋め込む層。
Source-Target-Attention層
異なる文章同士の照応関係(類似度や重要度)を獲得する層。
出典:”Attention Is All You Need”
38
39. 生成モデルについて
“Attention Is All You Need”
• Attention層自体は、すでに2015年あたりに登場。
→ RNNの「あまりにも長文になると精度が下がってしまう問題」を
解決するために使われてはいた。
→ リカレント層を取り除くという発想には至らなかった。
• リカレント層がなくてもAttention層だけで十分じゃないか!
→ “Attention Is All You Need”
39
Transformer
→ リカレント層を取り除いて、Attention層 でモデルを構成
92. OpenAI APIを使ってみよう
Pythonで実装する ④APIリクエストを送って動作確認
• OpenAI公式HPに載っているサンプルコードを試してみる。
→ チャット補完(文法修正)を試してみる。
import os
import openai
# APIキーを設定
openai.organization = "[会社アカウントのOrganization ID]"
openai.api_key = os.getenv("OPENAI_API_KEY")
# 応答を取得するためのリクエストデータを定義
request_data = {
"model": "gpt-3.5-turbo",
"messages": [
{"role": "system", "content": "You will be provided with statements, and your task is to convert them to standard English."},
{"role": "user", "content": "She no went to the marcket"}
],
"temperature": 0,
"max_tokens": 256
}
# チャット補完APIにリクエストを送って応答を取得
response = openai.ChatCompletion.create(**request_data)
# メッセージの内容のみを表示
print(response['choices'][0]['message']['content'])
“ She no went to the marcket .”
↑
・リクエスト
「この文を標準的な英語の文に直してほしい」
← Openaiのチャット補完APIにリクエストを送って、
応答を取得
92