From 3d226d9bd526694ffecb39c6ba15cd2748ccf7ab Mon Sep 17 00:00:00 2001 From: Roman Grundkiewicz Date: Sun, 29 Oct 2017 12:39:23 +0000 Subject: Add a comment for SwishNodeOp --- src/graph/node_operators_unary.h | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'src/graph/node_operators_unary.h') diff --git a/src/graph/node_operators_unary.h b/src/graph/node_operators_unary.h index 2c205f17..38241258 100644 --- a/src/graph/node_operators_unary.h +++ b/src/graph/node_operators_unary.h @@ -196,21 +196,19 @@ struct TanhNodeOp : public NaryNodeOp { /** * Represents a rectified -linear node - * in an expression graph. + * href="https://en.wikipedia.org/wiki/Rectifier_(neural_networks)">rectified + * linear node in an expression graph. * - * This node implements the activation function - * \f$f(x) = \max(0, x)\f$ and its derivative: + * This node implements the activationfunction \f$ f(x) = \max(0, x) \f$ and + * its derivative: * - \f[ - f^\prime(x) = - \begin{cases} - 0 & \text{if } x \leq 0 \\ - 1 & \text{if } x > 0 - \end{cases} -\f] + * \f[ + * f^\prime(x) = + * \begin{cases} + * 0 & \text{if } x \leq 0 \\ + * 1 & \text{if } x > 0 + * \end{cases} + * \f] */ struct ReLUNodeOp : public UnaryNodeOp { template @@ -228,6 +226,16 @@ struct ReLUNodeOp : public UnaryNodeOp { const std::string type() { return "ReLU"; } }; +/** + * Represents a swish node + * in an expression graph. + * + * This node implements the activation function + * \f$ f(x) = x \cdot \sigma(x) \f$ + * and its derivative + * \f$ f^\prime(x) = f(x) + \sigma(x)(1 - f(x)) \f$ . + * + */ struct SwishNodeOp : public UnaryNodeOp { template SwishNodeOp(Args... args) : UnaryNodeOp(args...) {} -- cgit v1.2.3