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

Function _Relu

express/NeuralNetWorkOp.cpp:433–440  ·  view source on GitHub ↗

Given an input value x, it computes the output as x if x > 0 and slope * x if x <= 0. Args: x: A variable. slope: A float, a positive float value, it leakes the negative part by multiplying with `slope` rather than setting it to 0.0f. Returns: output: A variable with the same type as `x`. */

Source from the content-addressed store, hash-verified

431output: A variable with the same type as `x`.
432*/
433VARP _Relu(VARP x, float slope) {
434 std::unique_ptr<OpT> relu(new OpT);
435 relu->type = OpType_ReLU;
436 relu->main.type = OpParameter_Relu;
437 relu->main.value = new ReluT;
438 relu->main.AsRelu()->slope = slope;
439 return (Variable::create(Expr::create(relu.get(), {x})));
440}
441/*Given an input value x, it computes Rectified Linear 6: min(max(x, 0), 6).
442Args:
443x: A variable.

Callers 15

_shrinkFunction · 0.85
onExecuteMethod · 0.85
_selectActMethod · 0.85
onExecuteMethod · 0.85
onExecuteMethod · 0.85
_activateFunction · 0.85
onGradMethod · 0.85
onGradMethod · 0.85
onForwardMethod · 0.85
convertMethod · 0.85

Calls 3

AsReluMethod · 0.80
createFunction · 0.50
getMethod · 0.45

Tested by 3

makeComplexGraphFunction · 0.68
runMethod · 0.68
runMethod · 0.68