Skip to contents

The Sigmoid function is one of the basic function in Spreadgram algorithm. This function calculates the Sigmoid function of a specific node given the activation rates of the nodes and its neighbors. The equation writes $$\sigma (x,y) = {{\exp [a(x)a(y)]} \over {1 + \exp [a(x)a(y)]}}$$.

Usage

sigmoid(ax, ay, u = 1)

Arguments

ax

A vector of the activation rates of x, which is a set of the y's neighbors

ay

A scalar of the activation rate of node y.

u

If \(x \in N(y)\) then \(u = 1\), otherwise \(u = 0\).

Value

A vector of sigma

Examples


sigmoid(1:4, 2)
#> [1] 0.8807971 0.9820138 0.9975274 0.9996646