SpanNormalizationExtensions
Namespace: LLama.Extensions
Extensions to span which apply in-place normalization
1 |
|
Inheritance Object → SpanNormalizationExtensions
Attributes ExtensionAttribute
Methods
MaxAbsoluteNormalization(Single[])
In-place multiple every element by 32760 and divide every element in the span by the max absolute value in the span
1 |
|
Parameters
vector
Single[]
Returns
Single[]
The same array
MaxAbsoluteNormalization(Span<Single>)
In-place multiple every element by 32760 and divide every element in the span by the max absolute value in the span
1 |
|
Parameters
vector
Span<Single>
Returns
Span<Single>
The same span
TaxicabNormalization(Single[])
In-place divide every element in the array by the sum of absolute values in the array
1 |
|
Parameters
vector
Single[]
Returns
Single[]
The same array
Remarks:
Also known as "Manhattan normalization".
TaxicabNormalization(Span<Single>)
In-place divide every element in the span by the sum of absolute values in the span
1 |
|
Parameters
vector
Span<Single>
Returns
Span<Single>
The same span
Remarks:
Also known as "Manhattan normalization".
EuclideanNormalization(Single[])
In-place divide every element by the euclidean length of the vector
1 |
|
Parameters
vector
Single[]
Returns
Single[]
The same array
Remarks:
Also known as "L2 normalization".
EuclideanNormalization(Span<Single>)
In-place divide every element by the euclidean length of the vector
1 |
|
Parameters
vector
Span<Single>
Returns
Span<Single>
The same span
Remarks:
Also known as "L2 normalization".
EuclideanNormalization(ReadOnlySpan<Single>)
Creates a new array containing an L2 normalization of the input vector.
1 |
|
Parameters
vector
ReadOnlySpan<Single>
Returns
Single[]
The same span
PNormalization(Single[], Int32)
In-place apply p-normalization. https://en.wikipedia.org/wiki/Norm_(mathematics)#p-norm
-
-
1 |
|
Parameters
vector
Single[]
p
Int32
Returns
Single[]
The same array
PNormalization(Span<Single>, Int32)
In-place apply p-normalization. https://en.wikipedia.org/wiki/Norm_(mathematics)#p-norm
-
-
1 |
|
Parameters
vector
Span<Single>
p
Int32
Returns
Span<Single>
The same span