"Boolean" (ネットデコーダ)
NetDecoder["Boolean"]
詳細
- NetDecoder[…][input]はデコーダを入力に適用し,出力を作る.
- NetDecoder[…][{input1,input2,…}]はデコーダを入力のリストに適用し,出力のリストを作る.
- デコーダへの入力 input は範囲が0≤input≤1のスカラーである.
- NetDecoder[{"Boolean","InputDepth"->n}]は入力テンソルの深さが n であることを指定するのに使われる.デフォルトの深さは0で,これは入力が一つの実数であることを示す.
- ネットワークの構築時に"port"->NetDecoder[…]と指定することで,デコーダをネットワークの出力ポートに付加することができる.
- NetDecoder["Boolean"][data,prop]は入力データの特定の特性を計算するのに使うことができる.
- "Boolean"のデコーダがネットワークに付加されたとき,復号化された出力の特定の特性を計算するのに net[data,prop]または net[data,"oport"->prop]を使うことができる.
- "Boolean"のデコーダは以下の特性 prop を受け付ける:
-
"Decision" 最高確率のブール型のクラス False または True(デフォルト) "Probability" クラスTrueの確率 p "Entropy" 確率分布のエントロピー "RandomSample" ブールをその確率に比例してサンプル化する "RandomSample"->t 正の温度 t を使ったサンプル None 復号化を回避し,入力を返す
特性
例題
すべて開く すべて閉じる例 (1)
dec = NetDecoder["Boolean"]dec[0.2]dec[{0.2, 0.9, 0.5}]デコーダは確率を入力として捉え,"Probability"特性に対してIdentityとして振舞う:
dec[{0.2, 0.9, 0.5}, "Probability"]dec[{0.2, 0.9, 0.5}, "Entropy"]スコープ (2)
"Boolean"のデコーダをElementwiseLayerの出力ポートに付加する:
layer = ElementwiseLayer[LogisticSigmoid, "Output" -> NetDecoder["Boolean"]]layer[3]確率の行列をブール値の行列に変換する"Boolean"のデコーダを作る:
decoder = NetDecoder[{"Boolean", "InputDepth" -> 2}]layer = NetInitialize@NetChain[{{3, 3}, LogisticSigmoid}, "Input" -> "Real", "Output" -> decoder]layer[10.0]layer[10.0, "Probability"]layer[10.0, "Entropy"]