layerganza
Version:
A feed-forward neural network with injectable layers, activation functions, and optimizers.
23 lines (22 loc) • 429 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const slopeBelowZero = 0.01;
class LeakyRelu {
xToY(x) {
if (x > 0) {
return x;
}
else {
return slopeBelowZero * x;
}
}
yToSlope(y) {
if (y > 0) {
return 1;
}
else {
return slopeBelowZero;
}
}
}
exports.default = LeakyRelu;