Answers.Body: <p>The general answer to the behavior of combining common activation functions is that the laws of calculus must be applied, specifically differential calculus, the results must be obtained through experiment to be sure of the qualities of the assembled function, and the additional complexity is likely to increase computation time. The exception to such increase will be when the computational burden of the combination is small compared to the convergence advantages the combination provides.</p>
  <p>This appears to be true of Swish, the name given to the activation function defined as</p>
  <p><span class="math-container">$$f(x) = x \, \mathbb{S}(\beta x) \; \text{,}$$</span></p>
  <p>where <span class="math-container">$f()$</span> is the Swish activation function and <span class="math-container">$\mathbb{S}$</span> is the sigmoid function. Note that Swish is not strictly a combination of activation functions. It is formed through the addition of a hyper-parameter <span class="math-container">$\beta$</span> inside the sigmoid function and a multiplication of the input to the sigmoid function result.</p>
  <p>It does not appear to be developed by Google. The originally anonymously submitted paper (for double blind review as a ICLR 2018 paper), <a href="https://openreview.net/pdf?id=SkBYYyZRZ" rel="nofollow noreferrer"><em>Searching for Activation Functions</em></a>, was authored by Prajit Ramachandran, Barret Zoph, and Quoc V. Le around 2017. This is their claim.</p>
  <blockquote>
  <p>Our experiments show that the best discovered activation function, ... Swish, ... tends to work better than ReLU on deeper models across a number of challenging datasets.</p>
  </blockquote>
  <p>Any change in activation function to any one layer will, except in the astronomically rare case, impact accuracy, reliability, and computational efficiency. Whether the change is significant cannot be generalized. That's why new ideas are tested against data sets traditionally used to gauge usefulness<sup>1</sup>.</p>
  <p>Combining activation functions to form new activation functions is not common. For instance, AlexNet does not combine them.<sup>2</sup>. It is, however, very common to use different activation functions in different layers of a single, effective network design.</p>
  <hr />
  <p><strong>Footnotes</strong></p>
  <p>[1] Whether these traditions create a bias is another question. Those who follow the theory of use case analysis pioneered by Swedish computer scientist Ivar Hjalmar Jacobson or 6 Sigma ideas would say that these tests are unit test, not functional tests against real world use cases, and they have a point.</p>
  <p>[2] To correct any misconceptions that may arise from another answer, AlexNet, the name given to the approach outlined in <a href="http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf" rel="nofollow noreferrer"><em>ImageNet Classification with Deep Convolutional Neural Networks</em></a> (2012) by Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton from the University of Toronto, does not involve combining activation functions to form new ones. They write this.</p>
  <blockquote>
  <p>The output of the last fully-connected layer is fed to a 1000-way softmax which produces a distribution over the 1000 class labels.</p>
  <p>...</p>
  <p>The ReLU non-linearity is applied to the output of every convolutional and fully-connected layer. The internal layers are pure ReLU and the output layer is Softmax.</p>
  </blockquote>
  <p>There are also convolution kernels and pooling layers in the AlexNet approach's series of layers used by them, and the design has entered common use since their winning of the ImageNet competition in 2012. Other approaches have won subsequent competitions.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-12T01:34:20.170Z
Answers.LastActivityDate: 2019-01-12T01:34:20.170Z
Answers.LastEditDate: 2020-06-17T09:57:20.710Z
Answers.UserDisplayName: Douglas Daseeco
Body: <p>There are several activation functions, such as ReLU, sigmoid or <span class="math-container">$\tanh$</span>. What happens when I mix activation functions?</p>
  
  <p>I recently found that Google has developed Swish activation function which is (x*sigmoid). By altering activation function can it increase accuracy on small neural network problem such as XOR problem?</p>
  
Tags: <neural-networks><machine-learning><activation-functions><relu><sigmoid>
Title: What happens when I mix activation functions?
UserDisplayName: JSChang
ThreadText: # What happens when I mix activation functions?
  
  (Asked by: username_0 on 2019-01-04)
  
  There are several activation functions, such as ReLU, sigmoid or $\tanh$. What happens when I mix activation functions?
  
  I recently found that Google has developed Swish activation function which is (x\*sigmoid). By altering activation function can it increase accuracy on small neural network problem such as XOR problem?
  
  **Tags:** neural-networks, machine-learning, activation-functions, relu, sigmoid
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-01-12. Score: 3 | Accepted answer
  
  The general answer to the behavior of combining common activation functions is that the laws of calculus must be applied, specifically differential calculus, the results must be obtained through experiment to be sure of the qualities of the assembled function, and the additional complexity is likely to increase computation time. The exception to such increase will be when the computational burden of the combination is small compared to the convergence advantages the combination provides.
  
  This appears to be true of Swish, the name given to the activation function defined as
  
  $$f(x) = x \, \mathbb{S}(\beta x) \; \text{,}$$
  
  where $f()$ is the Swish activation function and $\mathbb{S}$ is the sigmoid function. Note that Swish is not strictly a combination of activation functions. It is formed through the addition of a hyper-parameter $\beta$ inside the sigmoid function and a multiplication of the input to the sigmoid function result.
  
  It does not appear to be developed by Google. The originally anonymously submitted paper (for double blind review as a ICLR 2018 paper), [*Searching for Activation Functions*](https://openreview.net/pdf?id=SkBYYyZRZ), was authored by Prajit Ramachandran, Barret Zoph, and Quoc V. Le around 2017. This is their claim.
  
  > Our experiments show that the best discovered activation function, ... Swish, ... tends to work better than ReLU on deeper models across a number of challenging datasets.
  
  Any change in activation function to any one layer will, except in the astronomically rare case, impact accuracy, reliability, and computational efficiency. Whether the change is significant cannot be generalized. That's why new ideas are tested against data sets traditionally used to gauge usefulness1.
  
  Combining activation functions to form new activation functions is not common. For instance, AlexNet does not combine them.2. It is, however, very common to use different activation functions in different layers of a single, effective network design.
  
  ---
  
  **Footnotes**
  
  [1] Whether these traditions create a bias is another question. Those who follow the theory of use case analysis pioneered by Swedish computer scientist Ivar Hjalmar Jacobson or 6 Sigma ideas would say that these tests are unit test, not functional tests against real world use cases, and they have a point.
  
  [2] To correct any misconceptions that may arise from another answer, AlexNet, the name given to the approach outlined in [*ImageNet Classification with Deep Convolutional Neural Networks*](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf) (2012) by Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton from the University of Toronto, does not involve combining activation functions to form new ones. They write this.
  
  > The output of the last fully-connected layer is fed to a 1000-way softmax which produces a distribution over the 1000 class labels.
  >
  > ...
  >
  > The ReLU non-linearity is applied to the output of every convolutional and fully-connected layer. The internal layers are pure ReLU and the output layer is Softmax.
  
  There are also convolution kernels and pooling layers in the AlexNet approach's series of layers used by them, and the design has entered common use since their winning of the ImageNet competition in 2012. Other approaches have won subsequent competitions.
  
  
  ---
  
  