Ejemplo n.º 1
0
 /// <summary>ベルヌーイ分布に従う2値</summary>
 public static VariableField BinaryRandom(Shape shape, Random random, float prob)
 {
     return(VariableNode.BinaryRandom(shape, random, prob));
 }
Ejemplo n.º 2
0
        /// <summary>四元数2項演算</summary>
        internal static VariableNode QuaternionBinaryArithmetric(VariableNode x1, VariableNode x2, Operators.QuaternionBinaryArithmetric.QuaternionBinaryArithmetric arithmetric)
        {
            Function function = new Functions.QuaternionArithmetric.QuaternionBinaryArithmetric(arithmetric);

            return(Apply(function, x1, x2)[0]);
        }
Ejemplo n.º 3
0
        /// <summary>チャネル拡張</summary>
        public static VariableNode ExpandChannel(VariableNode x, int expands)
        {
            Function function = new Functions.ArrayManipulation.ExpandChannel(x.Shape, expands);

            return(Apply(function, x)[0]);
        }
Ejemplo n.º 4
0
        /// <summary>実数から3次元ベクトルを構成</summary>
        public static VariableNode TrivectorCast(VariableNode x, VariableNode y, VariableNode z)
        {
            Function function = new Functions.Trivector.TrivectorCast();

            return(Apply(function, x, y, z)[0]);
        }
Ejemplo n.º 5
0
        /// <summary>四元数純第2成分</summary>
        public static VariableNode QuaternionPureI(VariableNode X)
        {
            Function function = new Functions.Quaternion.QuaternionPureI();

            return(Apply(function, X)[0]);
        }
Ejemplo n.º 6
0
        /// <summary>軸反転</summary>
        public static VariableNode Flip(VariableNode x, int axis)
        {
            Function function = new Functions.ArrayManipulation.Flip(axis);

            return(Apply(function, x)[0]);
        }
Ejemplo n.º 7
0
        /// <summary>複素実部</summary>
        public static VariableNode ComplexReal(VariableNode x)
        {
            Function function = new Functions.Complex.ComplexReal();

            return(Apply(function, x)[0]);
        }
Ejemplo n.º 8
0
        /// <summary>3次元ベクトル純Y成分</summary>
        public static VariableNode TrivectorPureY(VariableNode X)
        {
            Function function = new Functions.Trivector.TrivectorPureY();

            return(Apply(function, X)[0]);
        }
Ejemplo n.º 9
0
        /// <summary>ソート</summary>
        public static (VariableNode key, VariableNode value) SortWithKey(VariableNode k, VariableNode v, int axis)
        {
            Function function = new Functions.ArrayManipulation.SortWithKey(axis);

            VariableNode[] kv = Apply(function, k, v);

            return(kv[0], kv[1]);
        }
Ejemplo n.º 10
0
        /// <summary>3次元ベクトル3次元カーネル積</summary>
        public static VariableNode TrivectorKernelProduct3D(VariableNode x, VariableNode y, VariableNode q, int kwidth, int kheight, int kdepth, int stride, bool transpose = false)
        {
            Function function =
                new Functions.TrivectorConvolution.TrivectorKernelProduct3D(x.Shape, y.Shape, kwidth, kheight, kdepth, stride, transpose);

            VariableNode w = Apply(function, x, y, q)[0];

            return(w);
        }
Ejemplo n.º 11
0
        /// <summary>3次元ベクトル2項演算</summary>
        internal static VariableNode TrivectorBinaryArithmetric(VariableNode v, VariableNode u, Operators.TrivectorBinaryArithmetric.TrivectorBinaryArithmetric arithmetric)
        {
            Function function = new Functions.TrivectorArithmetric.TrivectorBinaryArithmetric(arithmetric);

            return(Apply(function, v, u)[0]);
        }
Ejemplo n.º 12
0
 /// <summary>一様乱数を生成(XorShift)</summary>
 /// <remarks>値域 : [0, 1)</remarks>
 public static VariableField UniformRandom(Shape shape, Random random)
 {
     return(VariableNode.UniformRandom(shape, random));
 }
Ejemplo n.º 13
0
        /// <summary>複素純実数</summary>
        public static VariableNode ComplexPureReal(VariableNode real)
        {
            Function function = new Functions.Complex.ComplexPureReal();

            return(Apply(function, real)[0]);
        }
Ejemplo n.º 14
0
        /// <summary>チャネル方向に切り出し</summary>
        public static VariableNode ExtractChannel(VariableNode x, int index, int channels)
        {
            Function function = new Functions.ArrayManipulation.ExtractChannel(index, channels);

            return(Apply(function, x)[0]);
        }
        /// <summary>3次元ベクトル全結合カーネル積</summary>
        public static VariableNode TrivectorKernelProductDense(VariableNode x, VariableNode y, VariableNode q, bool transpose = false)
        {
            Function function =
                new Functions.TrivectorConvolution.TrivectorKernelProductDense(x.Shape, y.Shape, transpose);

            VariableNode w = Apply(function, x, y, q)[0];

            return(w);
        }
Ejemplo n.º 16
0
        /// <summary>3次元ベクトルZ成分</summary>
        public static VariableNode TrivectorZ(VariableNode x)
        {
            Function function = new Functions.Trivector.TrivectorZ();

            return(Apply(function, x)[0]);
        }
Ejemplo n.º 17
0
        /// <summary>チャネル方向に挿入</summary>
        internal static VariableNode InsertChannel(VariableNode x, int index, int channels)
        {
            Function function = new Functions.ArrayManipulation.InsertChannel(index, channels);

            return(Apply(function, x)[0]);
        }
Ejemplo n.º 18
0
 /// <summary>コンストラクタ</summary>
 /// <param name="node">入力ノード</param>
 /// <param name="tensor">テンソル</param>
 /// <param name="name">ノード名</param>
 /// <remarks>tensor を null にした場合フロー構築時にテンソルが割り当てられる</remarks>
 internal OutputNode(VariableNode node, Tensor tensor = null, string name = "")
     : base(node.Shape, tensor, node)
 {
     this.Name = name;
 }
Ejemplo n.º 19
0
        /// <summary>3次元ベクトル四元数回転積四元数勾配</summary>
        internal static VariableNode TrivectorQuaternionMulQGrad(VariableNode v, VariableNode u, VariableNode q)
        {
            Function function = new Functions.TrivectorArithmetric.TrivectorQuaternionMulQGrad();

            return(Apply(function, v, u, q)[0]);
        }
        /// <summary>2項演算</summary>
        internal static VariableNode FactorArithmetric(VariableNode x1, VariableNode x2, Operators.FactorArithmetric.FactorArithmetric factorbinary_operator)
        {
            Function function = new Functions.FactorArithmetric.FactorArithmetric(factorbinary_operator);

            return(Apply(function, x1, x2)[0]);
        }
Ejemplo n.º 21
0
        /// <summary>分離</summary>
        public static VariableNode[] Separate(VariableNode x, int axis, int[] lengths)
        {
            Function function = new Functions.ArrayManipulation.Separate(axis, lengths);

            return(Apply(function, x));
        }
Ejemplo n.º 22
0
        /// <summary>2項演算</summary>
        internal static VariableNode BinaryLeftVectorArithmetric(VariableNode x1, VariableNode x2, Operators.BinaryArithmetric.BinaryLeftVectorArithmetric binary_operator)
        {
            Function function = new Functions.BinaryLeftVectorArithmetric.BinaryLeftVectorArithmetric(binary_operator);

            return(Apply(function, x1, x2)[0]);
        }
Ejemplo n.º 23
0
        /// <summary>3項演算</summary>
        internal static VariableNode TrinaryArithmetric(VariableNode x1, VariableNode x2, VariableNode x3, Operators.TrinaryArithmetric.TrinaryArithmetric trinary_operator)
        {
            Function function = new Functions.TrinaryArithmetric.TrinaryArithmetric(trinary_operator);

            return(Apply(function, x1, x2, x3)[0]);
        }
Ejemplo n.º 24
0
        /// <summary>四元数第4成分</summary>
        public static VariableNode QuaternionK(VariableNode x)
        {
            Function function = new Functions.Quaternion.QuaternionK();

            return(Apply(function, x)[0]);
        }
Ejemplo n.º 25
0
        /// <summary>複素数1項演算</summary>
        internal static VariableNode ComplexUnaryArithmetric(VariableNode x, Operators.ComplexUnaryArithmetric.ComplexUnaryArithmetric arithmetric)
        {
            Function function = new Functions.ComplexArithmetric.ComplexUnaryArithmetric(arithmetric);

            return(Apply(function, x)[0]);
        }