/// <summary>インデクスをOneHot特徴量に変換</summary> public static VariableNode OneHotVector(VariableNode x, int channels) { Function function = new Functions.Indexer.OneHotVector(channels); VariableNode y = Apply(function, x)[0]; return(y); }
/// <summary>インデクスをOneHot特徴量に変換</summary> public static Tensor OneHotVector(Tensor x, int channels) { Function function = new Functions.Indexer.OneHotVector(channels); Tensor y = new Tensor(Shape.Map0D(channels, x.Channels)); function.Execute(new Tensor[] { x }, new Tensor[] { y }); return(y); }