Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
Regularization.cu
Go to the documentation of this file.
1// @(#)root/tmva/tmva/dnn:$Id$
2// Author: Simon Pfreundschuh 13/07/16
3
4/*************************************************************************
5 * Copyright (C) 2016, Simon Pfreundschuh *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12//////////////////////////////////////////////////////////////////
13// Contains the definitions of the kernel calling functions for //
14// computation of regularization functionals and gradients //
15// functions for CUDA architectures. //
16//////////////////////////////////////////////////////////////////
17
20#include "Kernels.cuh"
21
22namespace TMVA {
23namespace DNN {
24
25//______________________________________________________________________________
26template<typename AFloat>
40
41//______________________________________________________________________________
42template<typename AFloat>
57
58//______________________________________________________________________________
59template<typename AFloat>
73
74//______________________________________________________________________________
75template<typename AFloat>
90
91} // namspace DNN
92} // namspace TMVA
TCudaMatrix Class.
Definition CudaMatrix.h:103
size_t GetNcols() const
Definition CudaMatrix.h:160
static AFloat GetDeviceReturn()
Transfer the value in the device return buffer to the host.
Definition CudaMatrix.h:301
cudaStream_t GetComputeStream() const
Definition CudaMatrix.h:268
static AFloat * GetDeviceReturnPointer()
Return device pointer to the device return buffer.
Definition CudaMatrix.h:151
static void ResetDeviceReturn(AFloat value=0.0)
Set the return buffer on the device to the specified value.
Definition CudaMatrix.h:293
const AFloat * GetDataPointer() const
Definition CudaMatrix.h:163
size_t GetNrows() const
Definition CudaMatrix.h:159
static Scalar_t L1Regularization(const Matrix_t &W)
static void AddL2RegularizationGradients(Matrix_t &A, const Matrix_t &W, Scalar_t weightDecay)
static Scalar_t L2Regularization(const Matrix_t &W)
static void AddL1RegularizationGradients(Matrix_t &A, const Matrix_t &W, Scalar_t weightDecay)
AReal AFloat
Definition Cuda.h:70
static dim3 BlockDims2D()
Definition Device.h:55
static dim3 GridDims2D(int nrows, int ncols)
Definition Device.h:74
__global__ void AddL1RegularizationGradients(AFloat *A, const AFloat *B, AFloat weightDecay, int m, int n)
Definition Kernels.cuh:767
__global__ void AbsoluteSum(AFloat *result, const AFloat *A, int m, int n)
Definition Kernels.cuh:729
__global__ void AddL2RegularizationGradients(AFloat *A, const AFloat *B, AFloat weightDecay, int m, int n)
Definition Kernels.cuh:784
__global__ void SquaredSum(AFloat *result, const AFloat *A, int m, int n)
Definition Kernels.cuh:707
double weightDecay(double error, ItWeight itWeight, ItWeight itWeightEnd, double factorWeightDecay, EnumRegularization eRegularization)
compute the weight decay for regularization (L1 or L2)
create variable transformations