Source

AI/Training/Losses/generators.js

import { Order } from 'blockly/javascript';
/**
 * @category AI
 * @subcategory Training
 * @module Losses
 */
/**
 * Computes the mean squared error between two tensors.
 *
 * @param {Tensor} labels The ground truth output tensor, same dimensions as 'predictions'.
 * @param {Tensor} predictions The predicted outputs.
 * @returns {Tensor} tf.losses.meanSquaredError(labels,predictions)
 */
function MSE(block, generator) {
    const tensorA = generator.valueToCode(block, 'TENSOR_A', Order.NONE) || '';
    const tensorB = generator.valueToCode(block, 'TENSOR_B', Order.NONE) || '';
    return [`tf.losses.meanSquaredError(${tensorA},${tensorB})`, Order.VOID];
}
export const lossesBlockGenerator = {
    ['mean_squared_error']: MSE,
};
//# sourceMappingURL=generators.js.map