Table of Contents

Class ArrayFactoryRoutines

Namespace
NeuralNetworks.Core
Assembly
NeuralNetworks.dll

Provides factory and initialization routines for creating float arrays with range-based values, uniformly distributed random values, and normally distributed random values.

public static class ArrayFactoryRoutines
Inheritance
ArrayFactoryRoutines
Inherited Members

Remarks

Includes overloads for multiple array ranks and an in-place extension routine for filling two-dimensional arrays with reproducible random values from a seed.

Methods

CreateRandom(int, int, int, int, Random)

public static float[,,,] CreateRandom(int dim0, int dim1, int dim2, int dim3, Random random)

Parameters

dim0 int
dim1 int
dim2 int
dim3 int
random Random

Returns

float[,,,]

CreateRandom(int, int, Random)

Creates a new matrix filled with random values between -0.5 and 0.5, with the specified number of rows and columns.

public static float[,] CreateRandom(int rows, int columns, Random random)

Parameters

rows int

The number of rows in the matrix.

columns int

The number of columns in the matrix.

random Random

The random number generator.

Returns

float[,]

A new matrix filled with random values.

CreateRandom(int, Random)

public static float[] CreateRandom(int columns, Random random)

Parameters

columns int
random Random

Returns

float[]

CreateRandomNormal(int, int, int, int, Random, float, float)

public static float[,,,] CreateRandomNormal(int dim0, int dim1, int dim2, int dim3, Random random, float mean = 0, float stdDev = 1)

Parameters

dim0 int
dim1 int
dim2 int
dim3 int
random Random
mean float
stdDev float

Returns

float[,,,]

CreateRandomNormal(int, int, int, Random, float, float)

public static float[,,] CreateRandomNormal(int dim0, int dim1, int dim2, Random random, float mean = 0, float stdDev = 1)

Parameters

dim0 int
dim1 int
dim2 int
random Random
mean float
stdDev float

Returns

float[,,]

CreateRandomNormal(int, int, Random, float, float)

public static float[,] CreateRandomNormal(int rows, int columns, Random random, float mean = 0, float stdDev = 1)

Parameters

rows int
columns int
random Random
mean float
stdDev float

Returns

float[,]

CreateRandomNormal(int, Random, float, float)

public static float[] CreateRandomNormal(int columns, Random random, float mean = 0, float stdDev = 1)

Parameters

columns int
random Random
mean float
stdDev float

Returns

float[]

CreateRange(int, int, int, int, float, float)

public static float[,,,] CreateRange(int dim0, int dim1, int dim2, int dim3, float from, float to)

Parameters

dim0 int
dim1 int
dim2 int
dim3 int
from float
to float

Returns

float[,,,]

CreateRange(int, int, float, float)

public static float[,] CreateRange(int rows, int columns, float from, float to)

Parameters

rows int
columns int
from float
to float

Returns

float[,]

RandomInPlace(float[,], int)

Fills the source with random float values between -0.5 and 0.5 using the specified seed.

public static void RandomInPlace(this float[,] source, int seed)

Parameters

source float[,]

The two-dimensional array to fill with random values.

seed int

The seed used to initialize the random number generator.