All Bundles
Matrix2D
2D matrix operations
Operations
Add
Adds a constant to a matrix
function : native : Add(c:Float, m:Float[,]) ~ Float[,]
Parameters
Return
Adds a constant to a matrix
function : native : Add(m:Float[,], c:Float) ~ Float[,]
Parameters
Return
Adds two matrices
function : native : Add(m1:Float[,], m2:Float[,]) ~ Float[,]
Parameters
Return
AverageColumn
Average of the given column
function : native : AverageColumn(c:Int, matrix:Float[,]) ~ Float
Parameters
Name | Type | Description |
---|
c | Int | column index |
matrix | Float[,] | matrix |
Return
Type | Description |
---|
Float | average of the column |
AverageRow
Average of the given row
function : native : AverageRow(r:Int, matrix:Float[,]) ~ Float
Parameters
Return
Type | Description |
---|
Float | average of the row |
Concatenate
Concatenates two matrix
function : Concatenate(a:Float[,], b:Float[,], is_row:Bool) ~ Float[,]
Parameters
Name | Type | Description |
---|
a | Float[,] | left matrix |
b | Float[,] | right matrix |
is_row | Bool | true concatenate by rows, false for columns |
Return
Type | Description |
---|
Float[,] | concatenated matrix |
Divide
Divides a constant by a matrix
function : native : Divide(c:Float, m:Float[,]) ~ Float[,]
Parameters
Return
Divides a constant by a matrix
function : native : Divide(m:Float[,], c:Float) ~ Float[,]
Parameters
Return
DotProduct
Calculates the dot product.
function : native : DotProduct(m1:Float[,], m2:Float[,]) ~ Float[,]
Parameters
Return
DotSigmoid
Calculates the Dot Product applying while applying the Sigmoid function to all elements
function : native : DotSigmoid(a:Float[,], b:Float[,]) ~ Float[,]
Parameters
Return
EuclideanDistance
Calculates the Euclidean Distance between the two vectors
function : native : EuclideanDistance(m1:Float[,]) ~ Float
Parameters
Name | Type | Description |
---|
m1 | Float[,] | data matrix |
Return
Type | Description |
---|
Float | Euclidean Distance between the two vectors |
GetColumn
Get the column from a matrix
function : native : GetColumn(c:Int, matrix:Float[,]) ~ Float[]
Parameters
Name | Type | Description |
---|
c | Int | column index |
matrix | Float[,] | matrix |
Return
Type | Description |
---|
Float[] | column from matrix |
GetRow
Get the row from a matrix
function : native : GetRow(r:Int, matrix:Float[,]) ~ Float[]
Parameters
Return
Type | Description |
---|
Float[] | row from matrix |
HadamardDivide
Divides two matrices using the Hadamard rule
function : native : HadamardDivide(m1:Float[,], m2:Float[,]) ~ Float[,]
Parameters
Return
HadamardProduct
Multiplies two matrices using the Hadamard rule
function : native : HadamardProduct(m1:Float[,], m2:Float[,]) ~ Float[,]
Parameters
Return
Identity
Creates an identity a matrix
function : native : Identity(s:Int) ~ Float[,]
Parameters
Name | Type | Description |
---|
s | Int | size of matrix |
Return
Inverse
Inverse of matrix
function : native : Inverse(a:Float[,]) ~ Float[,]
Parameters
Return
Multiple
Multiplies a constant by a matrix
function : native : Multiple(c:Float, m:Float[,]) ~ Float[,]
Parameters
Return
Multiplies a constant by a matrix
function : native : Multiple(m:Float[,], c:Float) ~ Float[,]
Parameters
Return
Random
Generates a random 2D array of values from 0.0 to 1.0
function : Random(rows:Int, cols:Int) ~ Float[,]
Parameters
Name | Type | Description |
---|
rows | Int | rows |
cols | Int | columns |
Return
RandomNormal
Generates a random normal distribution of values
function : RandomNormal(mean:Float, variance:Float, rows:Int, cols:Int) ~ Float[,]
Parameters
Name | Type | Description |
---|
mean | Float | center of values |
variance | Float | variance in values |
rows | Int | rows |
cols | Int | columns |
Return
Generates a random normal value
function : RandomNormal(mean:Float, variance:Float) ~ Float
Parameters
Name | Type | Description |
---|
mean | Float | center of values |
variance | Float | variance in values |
Return
Type | Description |
---|
Float | updated matrix |
Sigmoid
Sigmoid 'S' function
function : native : Sigmoid(x:Float) ~ Float
Parameters
Name | Type | Description |
---|
x | Float | input value |
Return
Type | Description |
---|
Float | Sigmoid value |
Applies the Sigmoid function to all elements
function : native : Sigmoid(b:Float[,]) ~ Float[,]
Parameters
Return
Solve
Solves a unit of equations
function : native : Solve(m1:Float[,], m2:Float[,]) ~ Float[]
Parameters
Return
Type | Description |
---|
Float[] | least squares |
Split
Splits a matrix
function : native : Split(b:Float[,], offset:Int, count:Int, is_row:Bool) ~ Float[,]
Parameters
Name | Type | Description |
---|
b | Float[,] | matrix |
offset | Int | offset index |
count | Int | number of rows to split |
is_row | Bool | true for row split, false for column |
Return
Subtract
Subtracts a constant from a matrix
function : native : Subtract(c:Float, m:Float[,]) ~ Float[,]
Parameters
Return
Adds a constant to a matrix
function : native : Subtract(m:Float[,], c:Float) ~ Float[,]
Parameters
Return
Subtracts two matrices
function : native : Subtract(m1:Float[,], m2:Float[,]) ~ Float[,]
Parameters
Return
SumColumn
Sum of the given column
function : native : SumColumn(c:Int, matrix:Float[,]) ~ Float
Parameters
Name | Type | Description |
---|
c | Int | column index |
matrix | Float[,] | matrix |
Return
Type | Description |
---|
Float | sum of the column |
SumRow
Sum of the given row
function : native : SumRow(r:Int, matrix:Float[,]) ~ Float
Parameters
Return
Type | Description |
---|
Float | sum of the row |
ToBool
Parsers a boolean value
function : ToBool(m:Float[,]) ~ Bool
Parameters
Return
Type | Description |
---|
Bool | boolean value |
ToFloat
Parsers a decimal value
function : ToFloat(m:Float[,]) ~ Float
Parameters
Return
Type | Description |
---|
Float | decimal value |
ToInt
Parsers an integer value
function : ToInt(m:Float[,]) ~ Int
Parameters
Return
Type | Description |
---|
Int | integer value |
Transpose
Transpose of matrix
function : native : Transpose(a:Float[,]) ~ Float[,]
Parameters
Return
Type | Description |
---|
Float[,] | transposed matrix |