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. */
| 984 | A variable. Has the same type as features. |
| 985 | */ |
| 986 | VARP _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. |
| 998 | Args: |
| 999 | params: A variable. The variables from which to gather values. |