Two sentences are tokenized and encoded by a BERT model. The first sentence describes two kids playing with a green crocodile float in a swimming pool. The second sentence describes two kids pushing an inflatable crocodile around in a pool. The tokenized sentences are passed through the BERT model, which outputs the encoded representations of the token sequences.
Two sentences are tokenized and encoded by a BERT model. The first sentence describes two kids playing with a green crocodile float in a swimming pool. The second sentence describes two kids pushing an inflatable crocodile around in a pool. The tokenized sentences are passed through the BERT model, which outputs the encoded representations of the token sequences.
10. 1954~1957年 FORTRAN
? FORmula TRANslation system(数式変換系)
? 現代のほぼすべてのプログラマが使う
「プログラミング言語」のはしり
? 抽象レベルの高い数式で書いた指示を
抽象レベルの低い機械語で書いた指示に
変換するシステム(自動プログラミング*)
10
* “The Fortran Automatic Coding System for the IBM 704” (1956)
システムができたのが54年、このマニュアルができたのが56年、
一般に入手可能になったのが57年。
37. 三次の項
a and b and c は手続型の考え方のCPU脳では
「a and bを計算してxとし、
それからx and cを計算すればよい」となる
一方、二値変数を{0, 1}としたら
a and b は a * b で表現できるが、
a and b and c は a * b * c になって
三次の項になってしまう!
37
39. 全通り書き出してみる
*: ab=c とする。
a b c ab bc ca *
0 0 0 0 0 0 T
0 0 1 0 0 0 F
0 1 0 0 0 0 T
0 1 1 0 1 0 F
1 0 0 0 0 0 T
1 0 1 0 0 1 F
1 1 0 1 0 0 F
1 1 1 1 1 1 T
39
40. 数学パズル
Tの時0、Fの時正の値になるような式Hを作れ
a b c ab bc ca *
0 0 0 0 0 0 T
0 0 1 0 0 0 F
0 1 0 0 0 0 T
0 1 1 0 1 0 F
1 0 0 0 0 0 T
1 0 1 0 0 1 F
1 1 0 1 0 0 F
1 1 1 1 1 1 T
40
41. 数学パズル
Tの時0、Fの時正の値になるような式Hを作れ
a b c ab bc ca *
0 0 0 0 0 0 T
0 0 1 0 0 0 F
0 1 0 0 0 0 T
0 1 1 0 1 0 F
1 0 0 0 0 0 T
1 0 1 0 0 1 F
1 1 0 1 0 0 F
1 1 1 1 1 1 T
41
H=c で8ケース中6ケース充足
111の時、H=0にしなければ
ならない
110の時、H>0にしなければ
ならない
43. 数学パズル
Tの時0、Fの時正の値になるような式Hを作れ
a b c ab bc ca * H
0 0 0 0 0 0 T 0
0 0 1 0 0 0 F 2
0 1 0 0 0 0 T 0
0 1 1 0 1 0 F 1
1 0 0 0 0 0 T 0
1 0 1 0 0 1 F 1
1 1 0 1 0 0 F 0
1 1 1 1 1 1 T 0
43
H=2c – bc – caなら
111の時H=0
次は110の時H>0を
目指す
44. 数学パズル
a b c ab bc ca *
0 0 0 0 0 0 T
0 0 1 0 0 0 F
0 1 0 0 0 0 T
0 1 1 0 1 0 F
1 0 0 0 0 0 T
1 0 1 0 0 1 F
1 1 0 1 0 0 F
1 1 1 1 1 1 T
44
110の時H>0で
Tの時0になるような式H’
があれば、それを足して
やればよい
a, bの係数は0であるべき
ab, bc, caが100の時正で
111の時0になる式H’
2ab – bc – ca はどうか?
45. 数学パズル
a b c ab bc ca * H'
0 0 0 0 0 0 T 0
0 0 1 0 0 0 F 0
0 1 0 0 0 0 T 0
0 1 1 0 1 0 F -1
1 0 0 0 0 0 T 0
1 0 1 0 0 1 F -1
1 1 0 1 0 0 F 1
1 1 1 1 1 1 T 0
45
2ab – bc – ca は 011と101
で-1になる
これが悪影響を及ぼさな
いためにはその2つのケー
スでH>1である必要があ
る
H=2c – bc – caだと1にな
るのでH=4c – 2bc – 2caに
すればよいのではないか