Source

AI/Layer/Convolutional/generators.js

import { Order } from 'blockly/javascript';
/**
 * @category AI
 * @subcategory Layer
 * @module Convolutional
 */
/**
 * Creates a 1D convolution layer.
 *
 * @param {Number} filters The dimensionality of the output space (i.e. the number of filters in the convolution).
 * @param {Number[] | null} kernelSize The dimensions of the convolution window. If kernelSize is a number, the convolutional window will be square.
 * @param {String} activation ('elu'|'hardSigmoid'|'linear'|'relu'|'relu6'| 'selu'|'sigmoid'|'softmax'|'softplus'|'softsign'|'tanh'|'swish'|'mish'|'gelu'|'gelu_new') Activation function of the layer.
 * @returns {Conv1D} tf.layers.conv1d({filters, kernelSize, activation}).
 */
function convolutionalLayer(block, generator) {
    const filters = generator.valueToCode(block, 'FILTERS', Order.NONE) || '';
    const kernel = generator.valueToCode(block, 'KERNEL', Order.NONE) || '';
    const activation = generator.valueToCode(block, 'ACTIVATION', Order.NONE) || '';
    return [`tf.layers.conv1d({ filters: ${filters}, kernelSize: ${kernel}, activation: ${activation} })`, Order.VOID];
}
export const layerBlockGenerator = {
    ['add_convolutional_layer']: convolutionalLayer,
};
//# sourceMappingURL=generators.js.map