UNPKG

keras-js

Version:

Run Keras models in the browser, with GPU support using WebGL

30 lines (23 loc) 621 B
"use strict"; 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 SpatialDropout1D extends _Layer.default { constructor(attrs = {}) { super(attrs); this.layerClass = 'SpatialDropout1D'; const { p = 0.5 } = attrs; this.description = `${p}`; this.p = Math.min(Math.max(0, p), 1); } call(x) { this.output = x; return this.output; } } exports.default = SpatialDropout1D;