TensorPrimitives.Sigmoid Method

Definition

Overloads

Sigmoid(ReadOnlySpan<Single>, Span<Single>)

Computes the element-wise sigmoid function on the specified non-empty tensor of single-precision floating-point numbers.

Sigmoid<T>(ReadOnlySpan<T>, Span<T>)

Computes the element-wise sigmoid function on the specified non-empty tensor of numbers.

Sigmoid(ReadOnlySpan<Single>, Span<Single>)

Source:
TensorPrimitives.cs
Source:
TensorPrimitives.Single.cs
Source:
TensorPrimitives.Single.cs

Computes the element-wise sigmoid function on the specified non-empty tensor of single-precision floating-point numbers.

public:
 static void Sigmoid(ReadOnlySpan<float> x, Span<float> destination);
public static void Sigmoid (ReadOnlySpan<float> x, Span<float> destination);
static member Sigmoid : ReadOnlySpan<single> * Span<single> -> unit
Public Shared Sub Sigmoid (x As ReadOnlySpan(Of Single), destination As Span(Of Single))

Parameters

x
ReadOnlySpan<Single>

The tensor, represented as a span.

destination
Span<Single>

The destination tensor.

Exceptions

x and destination reference overlapping memory locations and do not begin at the same location.

Remarks

This method effectively computes destination[i] = 1f / (1f + MathF.Exp(-x[i])).

This method may call into the underlying C runtime or employ instructions specific to the current architecture. Exact results may differ between different operating systems or architectures.

Applies to

Sigmoid<T>(ReadOnlySpan<T>, Span<T>)

Source:
TensorPrimitives.Sigmoid.cs
Source:
TensorPrimitives.Sigmoid.cs

Computes the element-wise sigmoid function on the specified non-empty tensor of numbers.

public:
generic <typename T>
 where T : System::Numerics::IExponentialFunctions<T> static void Sigmoid(ReadOnlySpan<T> x, Span<T> destination);
public static void Sigmoid<T> (ReadOnlySpan<T> x, Span<T> destination) where T : System.Numerics.IExponentialFunctions<T>;
static member Sigmoid : ReadOnlySpan<'T (requires 'T :> System.Numerics.IExponentialFunctions<'T>)> * Span<'T (requires 'T :> System.Numerics.IExponentialFunctions<'T>)> -> unit (requires 'T :> System.Numerics.IExponentialFunctions<'T>)
Public Shared Sub Sigmoid(Of T As IExponentialFunctions(Of T)) (x As ReadOnlySpan(Of T), destination As Span(Of T))

Type Parameters

T

Parameters

x
ReadOnlySpan<T>

The tensor, represented as a span.

destination
Span<T>

The destination tensor.

Exceptions

x and destination reference overlapping memory locations and do not begin at the same location.

Remarks

This method effectively computes destination[i] = 1f / (1f + T.Exp(-x[i])).

This method may call into the underlying C runtime or employ instructions specific to the current architecture. Exact results may differ between different operating systems or architectures.

Applies to