sigmoid


sigmoid, a Python code which evaluates the sigmoid function s(x)=1/(1+exp(-x)) or a derivative of any order. The test code creates graphic images.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

sigmoid is available in a C version and a C++ version and a Fortran77 version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.

Related Data and Programs:

dirichlet, a Python code which evaluates the Dirichlet kernel function, sometimes called the periodic sinc function. The function includes a parameter n, normally taken to be an integer. The function is defined by diric(x,n)=sin(0.5*n*x)/n/sin(0.5*x). Sample plots of these functions are made.

fresnel, a Python code which evaluates the Fresnel cosine and sine integrals.

gaussian, a Python code which evaluates the Gaussian function for arbitrary mu and sigma, its antiderivative, and derivatives of arbitrary order.

humps, a Python code which evaluates the humps() function, its first and second derivatives, and its antiderivative. The functions are plotted.

lagrange, a Python code which evaluates any Lagrange basis polynomial L(i)(x), its antiderivative, or its first or second derivatives. Sample plots are made.

runge, a Python code which evaluates the Runge() function, its first and second derivatives, and its antiderivative. This function causes a breakdown for polynomial interpolation over equally spaced nodes in [-1,+1]. Plots of these functions are made.

sinc, a Python code which evaluates the sinc() function, its first and second derivative and its antiderivative. The normalized function is defined by sincn=sin(pi*x)/(pi*x), the unnormalized function is sincu=sin(x)/x. Plots of these functions are made.

steinerberger, a Python code which evaluates the Steinerberger function, a continuous function with discontinuous derivative, which is very hard to accurately plot, integrate, minimize, or interpolate. Plots are made of several of the functions.

Reference:

  1. Joe McKenna,
    Derivatives of the sigmoid function,
    https://joepatmckenna.github.io/calculus/derivative/sigmoid%20function/linear%20albegra/2018/01/20/sigmoid-derivs/

Source Code:


Last revised on 22 May 2024.