23 template <
typename O,
typename L>
25 return scale *
sum((labels >>
log(output)) + ((1.0 - labels) >>
log(1.0 - output)));
34 template <
typename O,
typename L>
36 return scale *
asum(labels - output);
45 template <
typename O,
typename L>
47 return std::make_pair(bce_loss(output, labels, alpha), bce_error(output, labels, beta));
Definition: prob_pooling.hpp:10
auto scale(LE &&lhs, RE &&rhs)
Builds an expression representing the scalar multiplication of lhs and rhs.
Definition: binary_expression_builder.hpp:64
value_t< E > asum(E &&values)
Returns the sum of all the absolute values contained in the given expression.
Definition: expression_builder.hpp:637
value_t< E > sum(E &&values)
Returns the sum of all the values contained in the given expression.
Definition: expression_builder.hpp:624
typename decay_traits< E >::value_type value_t
Traits to extract the value type out of an ETL type.
Definition: tmp.hpp:81
auto log(E &&value) -> detail::unary_helper< E, log_unary_op >
Apply logarithm (base e) on each value of the given expression.
Definition: function_expression_builder.hpp:64