24template<
typename AFloat>
26 const TCpuMatrix<AFloat> & A)
28 auto f = [](AFloat
x) {
return 1.0 / (1.0 +
exp(-
x));};
32template<
typename AFloat>
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.
AFloat * GetRawDataPointer()
Return raw pointer to the elements stored contiguously in column-major order.
static Executor & GetThreadExecutor()
static void Sigmoid(Tensor_t &B)
static void Softmax(Matrix_t &YHat, const Matrix_t &)
auto Map(F func, unsigned nTimes) -> std::vector< InvokeResult_t< F > >
Wrap TExecutor::Map functions.
RVec< PromoteType< T > > exp(const RVec< T > &v)
create variable transformations
static uint64_t sum(uint64_t i)