logistic method

List<double> logistic(
  1. List<double> val
)

Logistic activation function:

f(x) = 1 / (1 + exp(-x))

Implementation

List<double> logistic(List<double> val) {
  val.asMap().forEach((i, v) => val[i] = 1.0 / (1.0 + exp(-val[i])));
  return val;
}