Learn R Programming

neuralGAM (version 2.0.1)

validate_activation: Validate/resolve a Keras activation

Description

Validate/resolve a Keras activation

Usage

validate_activation(activation)

Value

a callable activation (Python callable) or the original R function.

Arguments

activation

character or function. If character, must be a valid tf.keras activation identifier (e.g., "relu", "gelu", "swish", ...).

Examples

Run this code
if (FALSE) {
library(neuralGAM)
act <- neuralGAM:::validate_activation("relu")     # ok
act <- neuralGAM:::validate_activation(function(x) x)  # custom
}

Run the code above in your browser using DataLab