# What Is The Sigmoid Linear Unit (SiLU) In A Neural Network C++ App

What is Sigmoid Linear Unit in a neural network created with a C++ app? How can we use the SiLU function in an artificial neural network (ANN)? Where can we use SiLU in AI technologies? Let’s remind ourselves of the activation function and explain these terms.

## What is an activation function and how can we use it in a C++ app?

Activation Function ( phi() ) also called as transfer function, or threshold function that determines the activation value ( a = phi(sum) ) from a given value (sum) from the Net Input Function . Net Input Function, here the sum is a sum of signals in their weights, and activation function is a new value of this sum with a given function or conditions. In another term. The activation function is a way to transfer the sum of all weighted signals to a new activation value of that signal. There are different activation functions, mostly Linear (Identity), bipolar and logistic (sigmoid) functions are used. The activation function and its types are explained well here.

In a C++ app (in general in most Programming Languages) you can create your activation function. Note that sum is the result of Net Input Function which calculates the sum of all weighted signals. We will use some as a result of the input function. Here activation value of an artificial neuron (output value) can be written by the activation function as below,

By using this sum Net Input Function Value and phi() activation functions, let’s see some of activation functions in C++; Now Let’s see how we can use Binary Step Function as in this example formula,

## What is a sigmoid linear unit (SiLU)?

Sigmoid Linear Unit (SiLU) also known as Sigmoid-Weighted Linear Unit is an activation function that uses the sigmoid function with multiplication itself. In other words, the activation of the SiLU is computed by the sigmoid function multiplied by its input. Stefan Elfwinga, Eiji Uchibea, Kenji Doyab were explained SiLU well in their “Sigmoid-Weighted Linear Units for Neural Network Function Approximation in Reinforcement Learning” study in 2017. They also used dSiLU term which is the derivative SiLU.

Let’s remember sigmoid function,

here f(x) is activation function ( we use phi() ) and the x is sum of weighted inputs.

Thus, Sigmoid Linear Unit (SiLU) is,

This SiLU function can be written in C++ as below

## A simple ANN C++ app example with SiLU activation function

Why not download a free trial of C++ Builder and try these examples for yourself today?