keras-js
Version:
Run Keras models in the browser, with GPU support using WebGL
30 lines (23 loc) • 606 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _Layer = _interopRequireDefault(require("../../Layer"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
class Dropout extends _Layer.default {
constructor(attrs = {}) {
super(attrs);
this.layerClass = 'Dropout';
const {
rate = 0.5
} = attrs;
this.description = `${rate}`;
this.rate = Math.min(Math.max(0, rate), 1);
}
call(x) {
this.output = x;
return this.output;
}
}
exports.default = Dropout;
;