コード例 #1
0
ファイル: MaxPooling.cs プロジェクト: ziichuan/KelpNet-master
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Creates the kernel. </summary>
        ///
        /// <seealso cref="M:KelpNet.Common.Functions.IParallelizable.CreateKernel()"/>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public void CreateKernel()
        {
            if (GpuEnable)
            {
                ForwardKernel = Weaver.CreateProgram(Weaver.GetKernelSource(FUNCTION_NAME)).CreateKernel("MaxPoolingForward");
            }
        }
コード例 #2
0
ファイル: Dropout.cs プロジェクト: Kawaian/KelpNet
        public void CreateKernel()
        {
            string         kernelSource = Weaver.GetKernelSource(FUNCTION_NAME);
            ComputeProgram program      = Weaver.CreateProgram(kernelSource);

            ForwardKernel  = program.CreateKernel("DropoutForward");
            BackwardKernel = program.CreateKernel("DropoutBackward");
        }
コード例 #3
0
        public void CreateKernel()
        {
            string kernelSource = this.ActivateFunctionString + this.ActivateKernelString;

            ComputeProgram program = Weaver.CreateProgram(kernelSource);

            this.ForwardKernel  = program.CreateKernel(this.ForwardKernelName);
            this.BackwardKernel = program.CreateKernel(this.BackwardKernelName);
        }
コード例 #4
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Creates the kernel. </summary>
        ///
        /// <seealso cref="M:KelpNet.Common.Functions.IParallelizable.CreateKernel()"/>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public void CreateKernel()
        {
            if (GpuEnable)
            {
                string kernelSource = ActivateFunctionString + ActivateKernelString;

                ComputeProgram program = Weaver.CreateProgram(kernelSource);
                ForwardKernel  = program?.CreateKernel(ForwardKernelName);
                BackwardKernel = program?.CreateKernel(BackwardKernelName);
            }
        }
コード例 #5
0
        public void CreateKernel()
        {
            string kernelSource = KernelString;

            if (this.Activator != null)
            {
                kernelSource = this.Activator.ActivateFunctionString + KernelString;
            }

            ComputeProgram program = Weaver.CreateProgram(kernelSource);

            this.ForwardKernel = program.CreateKernel(this.ForwardKernelName);
            BackwardgWKernel   = program.CreateKernel(BackwardgWKernelName);
            BackwardgXKernel   = program.CreateKernel(BackwardgXKernelName);
        }
コード例 #6
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Creates the kernel. </summary>
        ///
        /// <seealso cref="M:KelpNet.Common.Functions.IParallelizable.CreateKernel()"/>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public void CreateKernel()
        {
            if (GpuEnable)
            {
                string kernelSource = KernelString;

                if (Activator != null)
                {
                    kernelSource = Activator.ActivateFunctionString + KernelString;
                }

                ComputeProgram program = Weaver.CreateProgram(kernelSource);
                ForwardKernel    = program?.CreateKernel(ForwardKernelName);
                BackwardgWKernel = program?.CreateKernel(BackwardgWKernelName);
                BackwardgXKernel = program?.CreateKernel(BackwardgXKernelName);
            }
        }
コード例 #7
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Creates the kernel. </summary>
        ///
        /// <seealso cref="M:KelpNet.Common.Functions.IParallelizable.CreateKernel()"/>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public void CreateKernel()
        {
            if (GpuEnable)
            {
                string kernelSource = KernelString;

                if (Activator != null)
                {
                    kernelSource = Activator.ActivateFunctionString + KernelString;
                }

                if (Verbose)
                {
                    RILogManager.Default?.SendDebug("CreateKernel -> KernelSource is " + kernelSource);
                }
                ComputeProgram program = Weaver.CreateProgram(kernelSource);
                ForwardKernel    = program?.CreateKernel(ForwardKernelName);
                BackwardgWKernel = program?.CreateKernel(BackwardgWKernelName);
                BackwardgXKernel = program?.CreateKernel(BackwardgXKernelName);
            }
        }