极简代码(八)—— binary activation function

二值化的激活函数:

x > 1 ? 1 : -1; ⇒ [1, -1];
            x = 0 ⇒ -1;
  • 当然也可以使用sign() 函数(求符号函数):
sign(x)
        % 但要注意的是,sign(0) ⇒ ?
原文地址:https://www.cnblogs.com/mtcnn/p/9422654.html