Skip to content

← elementwise_math package

Sigmoid

Apply a sigmoidal (dampening/squashing) transform to each element in the data.

The transform employed here is a generalization of the function y=1/1+exp(-x)), which includes pre-scaling and pre-shift as well as post-scaling and post-shift constants, which can be used to scale and shift the standard sigmoid function graph horizontally and vertically, following the modified formula: y = vshift + scale * (1/(exp(-slope*(x - hshift)))). This function can be used to ensure that the data lie in a given range, without performing a hard thresholding like the Clamp operation. See also the more... link for more information on the unmodified (standard) sigmoid transform. More Info... Version 1.1.0

Ports/Properties

data

Data to process.

verbose name
Data
default value
None
port type
DataPort
value type
AnyNumeric (can be None)
data direction
INOUT

hshift

Shift before sigmoid transform. Shifts the function graph horizontally.

verbose name
Hshift
default value
0.0
port type
FloatPort
value type
float (can be None)

vshift

Shift after sigmoid transform. Shifts the function graph vertically.

verbose name
Vshift
default value
0.0
port type
FloatPort
value type
float (can be None)

scale

Scaling after sigmoid transform. This scales the function graph vertically.

verbose name
Scale
default value
1.0
port type
FloatPort
value type
float (can be None)

slope

Slope of the middle part of the sigmoidal curve. Larger values mean narrower range of squashing. Also the same as scaling before the sigmoid transform. This scales the function graph horizontally.

verbose name
Slope
default value
1.0
port type
FloatPort
value type
float (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)