face-api/build/common/convLayer.js

8 lines
328 B
JavaScript
Raw Normal View History

2020-08-20 02:10:42 +02:00
import * as tf from '@tensorflow/tfjs-core';
export function convLayer(x, params, padding = 'same', withRelu = false) {
2020-08-18 14:04:33 +02:00
return tf.tidy(() => {
const out = tf.add(tf.conv2d(x, params.filters, [1, 1], padding), params.bias);
return withRelu ? tf.relu(out) : out;
});
}
//# sourceMappingURL=convLayer.js.map