In artificial neural networks, activation functions are used for neurons, i.e. the sigmoid activation:

Sigmoid function

Which can be implemented in code as (in Python):

def sigmoid(x):
    return 1 / (1 + math.exp(-x))

How can we implement a biological activation function, such as the Hodgkin-Huxley model, whose mathematical form is:

enter image description here


  • Cm: Capacitance
  • Vm: Membrane potential

As mentioned on the Wikipedia page,

The typical Hodgkin–Huxley model treats each component of an excitable cell as an electrical element (as shown in the figure). The lipid bilayer is represented as a capacitance (Cm). Voltage-gated ion channels are represented by electrical conductances (gn, where n is the specific ion channel) that depend on both voltage and time. Leak channels are represented by linear conductances (gL). The electrochemical gradients driving the flow of ions are represented by voltage sources (En) whose voltages are determined by the ratio of the intra- and extracellular concentrations of the ionic species of interest. Finally, ion pumps are represented by current sources (Ip).[clarification needed] The membrane potential is denoted by Vm.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.