OneHot

パブリックファイナルクラスOneHot

ワンホットテンソルを返します。

`インデックス`のインデックスで表される場所は値 `on_value`を取り、他のすべての場所は値` off_value`を取ります。

入力 `indexes`がランク` N`の場合、出力はランク `N + 1`になります。新しい軸は次元` axis`に作成されます(デフォルト:新しい軸は最後に追加されます)。

`indices`がスカラーの場合、出力形状は長さ` depth`のベクトルになります。

`indices`が長さ` features`のベクトルの場合、出力形状は次のようになります。

features x depth if axis == -1
   depth x features if axis == 0
 
`indices`が形状` [batch、features] `の行列(バッチ)の場合、出力形状は次のようになります。
batch x features x depth if axis == -1
   batch x depth x features if axis == 1
   depth x batch x features if axis == 0
 
例== =======

indices = [0, 2, -1, 1]
   depth = 3
   on_value = 5.0
   off_value = 0.0
   axis = -1
 
とすると出力は `[4 x 3]`:
output =
   [5.0 0.0 0.0]  // one_hot(0)
   [0.0 0.0 5.0]  // one_hot(2)
   [0.0 0.0 0.0]  // one_hot(-1)
   [0.0 5.0 0.0]  // one_hot(1)
 
indices = [0, 2, -1, 1]
   depth = 3
   on_value = 0.0
   off_value = 3.0
   axis = 0
 
とすると出力は `[3 x 4]`:
output =
   [0.0 3.0 3.0 3.0]
   [3.0 3.0 3.0 0.0]
   [3.0 3.0 3.0 3.0]
   [3.0 0.0 3.0 3.0]
 //  ^                one_hot(0)
 //      ^            one_hot(2)
 //          ^        one_hot(-1)
 //              ^    one_hot(1)
 
80d7ad9320とすると出力は `[2 x 2 x 3]`:
output =
   [
     [1.0, 0.0, 0.0]  // one_hot(0)
     [0.0, 0.0, 1.0]  // one_hot(2)
   ][
     [0.0, 1.0, 0.0]  // one_hot(1)
     [0.0, 0.0, 0.0]  // one_hot(-1)
   ]
 

ネストされたクラス

クラスOneHot.OptionsOneHotオプションの属性

パブリックメソッド

出力<U>
asOutput ()
テンソルのシンボリックハンドルを返します。
静的OneHot.Options
(長軸)
static <U、T extends Number> OneHot <U>
createスコープスコープ、オペランド<T>インデックス、オペランド<整数>深さ、オペランド<U> onValue、オペランド<U> offValue、オプション...オプション)
新しいOneHot操作をラップするクラスを作成するファクトリメソッド。
出力<U>
出力()
ワンホットテンソル。

継承されたメソッド

パブリックメソッド

public Output <U> asOutput ()

テンソルのシンボリックハンドルを返します。

TensorFlow操作への入力は、別のTensorFlow操作の出力です。このメソッドは、入力の計算を表すシンボリックハンドルを取得するために使用されます。

public static OneHot.Options axis (長軸)

パラメーター
塗りつぶす軸(デフォルト:-1、新しい最も内側の軸)。

public static OneHot <U> create スコープスコープ、オペランド<T>インデックス、オペランド<整数>深度、オペランド<U> onValue、オペランド<U> offValue、オプション...オプション)

新しいOneHot操作をラップするクラスを作成するファクトリメソッド。

パラメーター
範囲現在のスコープ
インデックスインデックスのテンソル。
深さ1つのホットディメンションの深さを定義するスカラー。
onValue `indices [j] = i`の場合に出力に入力する値を定義するスカラー。
offValue `indices [j]!= i`のときに出力に入力する値を定義するスカラー。
オプションオプションの属性値を運ぶ
戻り値
  • OneHotの新しいインスタンス

public Output <U> output ()

ワンホットテンソル。