7

I'm new to machine learning (so excuse my nomenclature), and not being a python developer, I decided to jump in at the deep (no pun intended) end writing my own framework in C++.

In my current design, I have given each neuron/cell the possibility to have a different activation function. Is this a plausible design for a neural network? A lot of the examples I see use the same activation function for all neurons in a given layer.

Is there a model which may require this, or should all neurons in a layer use the same activation function? Would I be correct in using different activation functions for different layers in the same model, or would all layers have the same activation function within a model?

hanugm
  • 3,571
  • 3
  • 18
  • 50
lfgtm
  • 220
  • 1
  • 8
  • It's interesting that you take the challenge, but knowing python will help you a lot in the field of deep learning. If you already know C++ learning python will not take you much. – yosemite_k Feb 02 '23 at 01:18

1 Answers1

2

From here:

Using other activation functions don’t provide significant improvement in performance and tweaking them doesn’t provide any big improvement. So as per simplicity we use same activation function for most of the case in Deep Neural Networks.

Recessive
  • 1,346
  • 8
  • 21
  • Many thanks, so should the same activation function be used throughout the entire network/model, or is there still merit in using different activation functions for different layers in the same model? – lfgtm Dec 30 '19 at 00:37
  • @lfgtm Normally, there is an improvement in mixing activation functions across a network (keeping layers to just 1 though). An example of this, is in a CNN, where the net is all ReLU activations until the last layer where, for classification, it is a softmax activation. – Recessive Dec 30 '19 at 10:29
  • Many thanks this answers my questions. Kind Regards. – lfgtm Dec 30 '19 at 12:56
  • 2
    To me, this answer is not satisfactory, because you're quoting an answer from Quora, which may not even be reliable. There's no reference to a research paper that really supports the truth of this claim. What I suggest is that you read some literature about the topic, then edit this answer to improve it with references to good research material. – nbro Feb 03 '21 at 11:28