// Type: logistic
var hidden_activation = function(v) {
    for (var i = 0, l = v.length; i < l; i++) {
        if (v[i] > 0) {
            v[i] = -Math.log(1. + Math.exp(-v[i]));
        } else {
            v[i] = v[i] - Math.log(1. + Math.exp(-v[i]));
        }
    }
    return v;
};