MCPcopy Create free account
hub / github.com/alibaba/MNN / _Selu

Function _Selu

express/NeuralNetWorkOp.cpp:986–996  ·  view source on GitHub ↗

Computes scaled exponential linear: scale * alpha * (exp(features) - 1) if < 0, scale * features otherwise. Args: features: A variable of type Halide_Type_Float scale: Scaling factor (positive float) alpha: Alpha factor (positive float) Returns: A variable. Has the same type as features. */

Source from the content-addressed store, hash-verified

984A variable. Has the same type as features.
985*/
986VARP _Selu(VARP features, float scale, float alpha) {
987 std::unique_ptr<OpT> op(new OpT);
988 op->type = OpType_Selu;
989 auto seluParam = new SeluT;
990 op->main.type = OpParameter_Selu;
991 seluParam->scale = scale;
992 seluParam->alpha = alpha;
993 op->main.value = seluParam;
994 return (Variable::create(Expr::create(std::move(op), {features})));
995
996}
997/*Gather slices from params into a variable with shape specified by indices.
998Args:
999params: A variable. The variables from which to gather values.

Callers 3

_runMethod · 0.85
runMethod · 0.85
PyMNNExpr_seluFunction · 0.85

Calls 1

createFunction · 0.50

Tested by 2

_runMethod · 0.68
runMethod · 0.68