This layer applies element-wise activation function. Other layers, notably
dense can also apply activation functions. Use this isolated activation
function to extract the values before and after the
activation. For instance:
// Obtain the output symbolic tensors by applying the layers in order. constdenseOutput = denseLayer.apply(input); constactivationOutput = activationLayer.apply(denseOutput);
// Create the model based on the inputs. constmodel = tf.model({ inputs:input, outputs: [denseOutput, activationOutput] });
// Collect both outputs and print separately. const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5])); denseOut.print(); activationOut.print();
Applies an activation function to an output.
This layer applies element-wise activation function. Other layers, notably
dense
can also apply activation functions. Use this isolated activation function to extract the values before and after the activation. For instance: