24template<
typename AFloat>
26 const TCpuMatrix<AFloat> &
A)
28 auto f = [](AFloat
x) {
return 1.0 / (1.0 +
exp(-
x));};
32template<
typename AFloat>
36 const AFloat *dataA =
A.GetRawDataPointer();
37 AFloat *dataB =
B.GetRawDataPointer();
38 size_t n =
A.GetNcols();
39 size_t m =
A.GetNrows();
41 auto f = [&dataA, &dataB,
n,
m](
UInt_t workerID)
44 for (
size_t i = 0; i <
n; i++) {
45 sum +=
exp(dataA[workerID + i *
m]);
47 for (
size_t i = 0; i <
n; i++) {
48 dataB[workerID + i *
m] =
exp(dataA[workerID + i *
m]) /
sum;
A pseudo container class which is a generator of indices.
static void Sigmoid(TCpuMatrix< Scalar_t > &B)
static void Softmax(TCpuMatrix< Scalar_t > &YHat, const TCpuMatrix< Scalar_t > &)
Abstract ClassifierFactory template that handles arbitrary types.
static long int sum(long int i)