get_activation: Map a string to a Python function

View source: R/modeling.R

get_activationR Documentation

Map a string to a Python function

Description

Example: "relu" => 'tensorflow::tf$nn$relu'.

Usage

get_activation(activation_string)

Arguments

activation_string

String name of the activation function.

Value

A function corresponding to the activation function. If activation_string is NA, empty, or "linear", this will return NA. If activation_string is not a string, it will return activation_string.

Examples

## Not run: 
get_activation("gelu")

## End(Not run)

jonathanbratt/RBERT documentation built on Jan. 26, 2023, 4:15 p.m.