Bright Wire

Bright Wire is an open source machine learning library for .NET with GPU support

TrainingData.Artificial.And

Simple AND training data

Methods

  • IDataTable Get Generates a data table containing AND training data

ExecutionGraph.Node.BackpropagationBase<T>

Base class for node backpropagation

Methods

  • void Dispose Dispose
  • void Backward Called when backpropagating
    • INode fromNode The node that sent the backpropagation signal
    • IGraphData errorSignal The backpropagating error
    • IContext context Graph context
    • IReadOnlyList<BrightWire.INode> parents Parents of the current node
  • void _Backward Called when a valid error signal has been received
    • INode fromNode >The node that sent the backpropagation signal
    • IGraphData errorSignal The backpropagating error
    • IContext context Graph context
    • IReadOnlyList<BrightWire.INode> parents Parents of the current node

Models.Bayesian.BernoulliNaiveBayes

A bernoulli naive bayes model

Properties

Methods

TrainingData.Helper.BigEndianBinaryReader

Binary reader for big endian streams

Methods

  • void BigEndianBinaryReader Creates a new big endian binary reader
    • System.IO.Stream stream
  • int ReadInt32 Reads an int
  • System.Int16 ReadInt16 Reads a short
  • System.Int64 ReadInt64 Reads a long
  • uint ReadUInt32 Reads a ulong

ExecutionGraph.Node.Gate.BinaryGateBase

Base class for nodes that accept two input signals and output one signal

Methods

  • void BinaryGateBase Constructor
    • string name
  • void ExecuteForward Executes on the primary channel

TrainingData.Artificial.BinaryIntegers

Creates random integers and returns feature vectors against binary mathematical logic

Methods

  • IDataTable Addition Creates random integers added together as feature vectors The input feature contains two features, one for each bit at that position The output feature contains a single feature: 1 or 0 if that bit is set in the result
    • int sampleCount How many samples to generate
    • bool stochastic True to generate random integers

LinearAlgebra.Helper.BoundMath

Floating point helper that prevents values from getting too big or small

Methods

  • float Constrain Forces the value to lie within the valid range
    • float val Value to check
  • float Exp Bounded exponent
    • float val
  • float Log Bounded natural log
    • float d
  • float Pow Bounded power
    • float x
    • float y
  • bool IsZero Returns true if the value approximates zero
    • float value Value to test
  • bool IsNotZero Returns true if the value is greater than zero
    • float value Value to test
  • bool AreEqual Checks if the two floating point numbers are equal (with a degree of tolerance)
    • float value1 First value to compare
    • float value2 Second value to compare
    • float tolerance Tolerance allowed between the numbers
  • IEqualityComparer<float> GetEqualityComparer Used for comparing floating point numbers (if they are within the tolerance they are considered equal)
    • float tolerance Tolerance to consider if two floating point numbers are the same

BrightWireGpuProvider

Provides a GPU based linear algebra provider

Methods

  • ILinearAlgebraProvider CreateLinearAlgebra Creates a linear alebra provider that runs on the GPU
    • bool stochastic False to disable random number generation
    • int memoryCacheSize The amount of device memory to use an application memory cache
    • string cudaKernelPath Path to .cubin or .ptx kernel file (defaults to .ptx file for forward compatability)
  • string GetKernelPath Returns the default cuda kernel path

BrightWireProvider

Main entry point

Methods

  • IDataTable ParseCSV Parses a CSV file into a data table
    • System.IO.StreamReader streamReader The stream of CSV data
    • System.Char delimeter The CSV delimeter
    • bool? hasHeader True if there is a header
    • System.IO.Stream output A stream to write the data table to (for file based processing) - null for in memory processing
  • IDataTable ParseCSV Parses a CSV string into a data table
    • string csv The string to parse
    • System.Char delimeter The CSV delimeter
    • bool? hasHeader True if there is a header
    • System.IO.Stream output A stream to write the data table to (for file based processing) - null for in memory processing
  • IDataTable ParseCSVToText Parses CSV into a data table without type detection - all columns will be strings
    • System.IO.StreamReader streamReader The streamn reader that contains the CSV to parse
    • System.Char delimeter The CSV delimeter
    • bool? hasHeader True if there is a header
    • System.IO.Stream output A stream to write the data table to (for file based processing) - null for in memory processing
  • IDataTable ParseCSVToText Parses CSV into a data table without type detection - all columns will be strings
    • string csv The string to parse
    • System.Char delimeter >The CSV delimeter
    • bool? hasHeader True if there is a header
    • System.IO.Stream output A stream to write the data table to (for file based processing) - null for in memory processing
  • IDataTable CreateDataTable Creates a data table from a stream
    • System.IO.Stream dataStream The stream that the data table was written to
    • System.IO.Stream indexStream The stream that the index was written to (optional)
  • ILinearAlgebraProvider CreateLinearAlgebra Creates a linear algebra provider that runs on the CPU
    • bool stochastic False to use the same random number generation each time
  • IDataTableBuilder CreateDataTableBuilder Creates a data table builder to programatically create data tables
    • System.IO.Stream stream
    • bool validate
  • IDataTableBuilder CreateDataTableBuilder Creates a data table builder to programatically create data tables
    • IEnumerable<BrightWire.IColumn> columns
    • System.IO.Stream stream
    • bool validate
  • IMarkovModelTrainer2<T> CreateMarkovTrainer2 Create a markov model trainer of window size 2
    • int minObservations Minimum number of data points to record an observation
  • IMarkovModelTrainer3<T> CreateMarkovTrainer3 Create a markov model trainer of window size 3
    • int minObservations Minimum number of data points to record an observation
  • IConvertToType CreateTypeConverter Returns a generic type converter that uses a default value if conversion fails
    • T defaultValue Value to use if the conversion fails

Models.Bayesian.NaiveBayes.CategorialProbability

A category and its associated log probability

Properties

  • string Category The category label
  • double LogProbability The natural log of the category's probability
  • double Probability The category's probability

Models.DataTable.DataTableVectorisation.CategoricalIndex

A categorical column value

Properties

  • string Category The classification label
  • int Index The label's index

Models.Bayesian.BernoulliNaiveBayes.Class

A classification

Properties

  • string Label The classification label
  • double Prior The log of the prior probablilty for this classification
  • double MissingProbability The log of the missing probability
  • Models.Bayesian.BernoulliNaiveBayes.StringIndexProbability[] Index The list of probabilities for each string index
  • double InverseMissingProbability The log of the inverse missing probability

Models.Bayesian.MultinomialNaiveBayes.Class

Classification data

Properties

Models.Bayesian.NaiveBayes.ClassSummary

A classification and its associated data

Properties

  • string Label The classification label
  • double LogPrior The natural log of the prior
  • List<BrightWire.Models.Bayesian.NaiveBayes.Column> ColumnSummary The column data associated with this classification
  • double Prior The classification prior probability

Models.Bayesian.NaiveBayes.Column

A column within the naive bayes model

Properties

  • int ColumnIndex Index within the data set
  • Models.Bayesian.NaiveBayes.ColumnType Type Type of column (categorical or continuous)
  • double Variance The variance of the column values (continuous only)
  • double Mean The mean of the column values (continuous only)
  • List<BrightWire.Models.Bayesian.NaiveBayes.CategorialProbability> Probability The list of categories within the column and their probability (categorical only)

Models.DataTable.DataTableNormalisation.Column

A column model

Properties

  • int ColumnIndex The column index
  • ColumnType DataType The type of data in the column
  • double Subtract The value to subtract from the column
  • double Divide The value to divide the column with (after subtraction)

Methods

  • void Column Default constructor
  • void Column Constructor
    • int columnIndex
    • ColumnType dataType
    • double divide
    • double subtract
  • object Normalise Perform the normalisation step
    • double val The input value

Models.DataTable.DataTableVectorisation.Column

Column information

Properties

  • int ColumnIndex The column index
  • string Name Column name
  • bool IsTargetColumn True if the column is the classification target
  • bool IsContinuous True if the column has a continuous value
  • int Size The number slots this column will fill in the output vector
  • Models.DataTable.DataTableVectorisation.CategoricalIndex[] Values An array of categorial values

TreeBased.Training.DecisionTreeTrainer.Config

Properties

  • int? FeatureBagCount
  • int? MinDataPerNode
  • int? MaxDepth
  • double? MinInformationGain
  • int? MaxAttributes

Helper.ConvolutionHelper

Helper class to calculate convolutional indices

Methods

  • List<(System.Int32 X, System.Int32 Y)> LeftToRight Generates convolution indices from left to right
    • int width Input width
    • int height Input height
    • int filterWidth Filter width
    • int filterHeight Filter height
    • int stride Offset of each position
  • List<(System.Int32 X, System.Int32 Y)> TopToBottom Generates convolution indices from top to bottom
    • int width Input width
    • int height Input height
    • int filterWidth Filter width
    • int filterHeight Filter height
    • int stride Offset of each position

Models.DataSourceModel

Serialises an adaptive data source - that is, a data source that takes the output from a preliminary output graph and sends it to the primary graph

Properties

  • string Version Data contract version number
  • string Name The name of the data source
  • int InputSize The size of each input training data item
  • int OutputSize The size of each training item output (classification label)
  • Models.ExecutionGraph Graph The preliminary graph

Models.DataTable.DataTableNormalisation

A data table normalisation model

Properties

Methods

  • IReadOnlyList<object> Normalise Normalises a row in the data table
    • IReadOnlyList<object> row The row to normalise

Models.DataTable.DataTableVectorisation

A data table vectorisation model - maps rows in a data table to vectors

Properties

  • Models.DataTable.DataTableVectorisation.Column[] Columns The columns in the table
  • int InputSize The size of each input vector that will be created
  • int OutputSize The size of each output vector that will be created
  • bool HasTarget True if the vectoriser has a classification target column
  • bool IsTargetContinuous True if the classification target column is continuous
  • int ClassColumnIndex The column index of the classifiation target column
  • Dictionary<System.Int32, System.Collections.Generic.Dictionary<System.String, System.Int32>> ColumnMap A dictionary of column to categorical value tables
  • Dictionary<System.Int32, System.Collections.Generic.Dictionary<System.Int32, System.String>> ReverseColumnMap A dictionary of column to reversed categorical value tables

Methods

  • string GetOutputLabel Returns the classification label for the corresponding column/vector indices
    • int columnIndex The data table column index
    • int vectorIndex The one hot vector index
  • Models.FloatVector GetInput Vectorises the input columns of the specified row
    • IRow row >The row to vectorise
  • Models.FloatVector GetOutput Vectorises the output column of the specified row
    • IRow row The row to vectorise

Helper.DebugHelpers

Helper classes useful when debugging BW

Methods

Models.DecisionTree

A decision tree model

Properties

  • int ClassColumnIndex The classification label column index
  • Models.DecisionTree.Node Root The root of the tree
  • string AsXml Converts the tree to XML

Methods

ExecutionGraph.GraphFactory.ErrorMetricProvider

Error metrics

Properties

Models.ExecutionGraph

A serialised execution graph

Properties

Models.ExecutionResult

The output from a mini batch

Properties

  • IReadOnlyList<BrightWire.Models.FloatVector> Output The list of output rows
  • IReadOnlyList<BrightWire.Models.FloatVector> Target The list of target rows
  • IReadOnlyList<IReadOnlyList<BrightWire.Models.FloatVector>> Input The list of input rows
  • IMiniBatchSequence MiniBatchSequence The mini batch

Methods

  • void ExecutionResult Constructor
    • IMiniBatchSequence miniBatch The mini batch sequence
    • IReadOnlyList<BrightWire.Models.FloatVector> output The mini batch output
  • float CalculateError Calculates the error of the output against the target
    • IErrorMetric errorMetric The error metric to calculate with

ExtensionMethods

Static extension methods

Methods

  • IEnumerable<T> Shuffle Shuffles the enumerable
    • IEnumerable<T> seq The sequence to shuffle
    • int? randomSeed The random seed to use or null for a random shuffle
  • IEnumerable<T> Shuffle Shuffles the enumerable
    • IEnumerable<T> seq The sequence to shuffle
    • System.Random rnd The random number generator to use
  • (System.Collections.Generic.IReadOnlyList<T> Training, System.Collections.Generic.IReadOnlyList<T> Test) Split Splits a sequence into training and test splits
    • IReadOnlyList<T> seq The sequence to split
    • double trainPercentage The percentage of the sequence to add to the training set
  • IReadOnlyList<T> Bag Bags (select with replacement) the input sequence
    • IReadOnlyList<T> list The input sequence
    • int count The size of the output sequence
    • int? randomSeed The random seed or null initialise randomlu

ExtensionMethods

Methods

  • System.Type GetColumnType Returns the underlying .net type associated with the column type
  • IReadOnlyList<(System.String Label, BrightWire.Models.WeightedIndexList Data)> ConvertToWeightedIndexList Converts the indexed classifications to weighted indexed classifications
    • IReadOnlyList<(System.String Label, BrightWire.Models.IndexList Data)> data
    • bool groupByClassification True to group by classification (i.e convert the bag to a set)
  • IDataTable ConvertToTable Converts indexed classifications to a data table
    • IReadOnlyList<(System.String Label, BrightWire.Models.IndexList Data)> data
  • IDataTable ConvertToTable Converts weighted index classifications to a data table
    • IReadOnlyList<(System.String Label, BrightWire.Models.WeightedIndexList Data)> data
  • IDataTable ConvertToTable Converts the vector classifications into a data table
    • IReadOnlyList<(System.String Label, BrightWire.Models.FloatVector Data)> data
    • bool preserveVectors True to create a data table with a vector column type, false to to convert to columns of floats
  • float GetMaxWeight Finds the greatest weight within the weighted index classification list
    • IReadOnlyList<(System.String Label, BrightWire.Models.WeightedIndexList Data)> data
  • uint GetMaxIndex Find the greatest index within the weighted index classification list
    • IReadOnlyList<(System.String Label, BrightWire.Models.WeightedIndexList Data)> data
  • uint GetMaxIndex Find the greatest index within the index classification list
    • IReadOnlyList<(System.String Label, BrightWire.Models.IndexList Data)> data
  • IReadOnlyList<(System.String Classification, BrightWire.Models.FloatVector Data)> Vectorise Converts the weighted index classification list to a list of dense vectors
    • IReadOnlyList<(System.String Label, BrightWire.Models.WeightedIndexList Data)> data
  • IReadOnlyList<(System.String Label, System.String Classification, System.Single Score)> Classify Classifies each row of the index classification list
    • IReadOnlyList<(System.String Label, BrightWire.Models.IndexList Data)> data
    • IIndexListClassifier classifier The classifier to classify each item in the list
  • IReadOnlyList<(System.String Label, BrightWire.Models.WeightedIndexList Data)> Normalise Normalises the weighted index classification list to fit between 0 and 1
    • IReadOnlyList<(System.String Label, BrightWire.Models.WeightedIndexList Data)> data
  • IReadOnlyList<(System.String Label, BrightWire.Models.WeightedIndexList Data)> TFIDF Modifies the weights in the classification set based on relative corpus statistics to increase the weight of important words relative to each document https://en.wikipedia.org/wiki/Tf%E2%80%93idf
    • IReadOnlyList<(System.String Label, BrightWire.Models.WeightedIndexList Data)> data

ExtensionMethods

Methods

  • void Train Trains a graph for a fixed number of iterations
    • IGraphTrainingEngine engine The graph training engine
    • int numIterations The number of iterations to train for
    • IDataSource testData The test data source to use
    • IErrorMetric errorMetric The error metric to evaluate the test data against
    • System.Action<BrightWire.Models.GraphModel> onImprovement Optional callback for when the test data score has improved against the error metric
    • int testCadence Determines how many epochs elapse before the test data is evaluated
  • IReadOnlyList<(BrightWire.IRow Row, System.String Classification)> Classifiy Classifies each row of the data table
  • Models.ExecutionGraph GetGraph Serialises the node and any other connected nodes to an execution graph
    • INode input
    • string name Name of the graph (optional)
  • INode CreateFrom Creates a node and any other connected nodes from a serialised execution graph
  • IReadOnlyList<BrightWire.Models.FloatVector[]> OrderSequentialOutput Aligns the output of sequential graph execution into an ordered list of results
    • IReadOnlyList<BrightWire.Models.ExecutionResult> results Output from sequential graph execution

ExtensionMethods

Methods

ExtensionMethods

Methods

  • IRandomProjection CreateRandomProjection Random projections allow you to reduce the dimensions of a matrix while still preserving significant information
    • ILinearAlgebraProvider lap Linear algebra provider
    • int fixedSize The vector size to reduce from
    • int reducedSize The vector size to reduce to
    • int s
  • Models.LogisticRegression TrainLogisticRegression Trains a logistic regression model on a data table
    • IDataTable table The training data
    • ILinearAlgebraProvider lap Linear algebra provider
    • int iterations Number of iterations to train for
    • float learningRate The learning rate
    • float lambda Regularisation lambda
    • System.Func<System.Single, System.Boolean> costCallback Optional callback that is called after each iteration with the current cost
  • ILogisticRegressionTrainer CreateLogisticRegressionTrainer Logistic regression learns a sigmoid function over a set of data that learns to classify future values into positive or negative samples
  • List<BrightWire.Models.Bayesian.MarkovModelStateTransition<T>> GetTransitions Find the next set of state transitions from a pair of observations
    • Dictionary<BrightWire.Models.Bayesian.MarkovModelObservation2<T>> model A markov model saved to a dictionary
    • T item1 The first observation
    • T item2 The second observation
  • List<BrightWire.Models.Bayesian.MarkovModelStateTransition<T>> GetTransitions Find the next set of state transitions from a tuple of observations
    • Dictionary<BrightWire.Models.Bayesian.MarkovModelObservation3<T>> model A markov model saved to a dictionary
    • T item1 The first observation
    • T item2 The second observation
    • T item3 The third observation
  • IReadOnlyList<IReadOnlyList<BrightWire.IVector>> NNMF Non negative matrix factorisation - clustering based on matrix factorisation. Only applicable for training data that is non-negative.
    • IReadOnlyList<BrightWire.IVector> data The training data
    • ILinearAlgebraProvider lap Linear alegbra provider
    • int k The number of clusters
    • int maxIterations The maximum number of iterations
  • IReadOnlyList<IReadOnlyList<BrightWire.IVector>> HierachicalCluster Hierachical clustering successively finds the closest distance between pairs of centroids until k is reached
    • IReadOnlyList<BrightWire.IVector> data The list of vectors to cluster
    • int k The number of clusters to find
  • IReadOnlyList<IReadOnlyList<BrightWire.IVector>> KMeans K Means uses coordinate descent and a distance metric between randomly selected centroids to cluster the data
    • IReadOnlyList<BrightWire.IVector> data The list of vectors to cluster
    • ILinearAlgebraProvider lap Linear algebra provider
    • int k The number of clusters to find
    • int maxIterations The maximum number of iterations
    • DistanceMetric distanceMetric Distance metric to use to compare centroids
  • Models.InstanceBased.KNearestNeighbours TrainKNearestNeighbours K Nearest Neighbours is an instance based classification method that uses examples from training data to predict classifications
  • Models.MultinomialLogisticRegression TrainMultinomialLogisticRegression Multinomial Logistic Regression generalises Logistic Regression to multi-class classification
    • IDataTable data The training data
    • ILinearAlgebraProvider lap Linear algebra provider
    • int trainingIterations Number of training iterations
    • float trainingRate Training rate
    • float lambda L2 regularisation
    • System.Func<System.Single, System.Boolean> costCallback Optional callback that is called after each iteration with the current cost
  • Models.RandomForest TrainRandomForest Random forests are built on a bagged collection of features to try to capture the most salient points of the training data without overfitting
    • IDataTable data The training data
    • int b The number of trees in the forest
  • Models.DecisionTree TrainDecisionTree Decision trees build a logical tree to classify data. Various measures can be specified to prevent overfitting.
    • IDataTable data The training data
    • int? minDataPerNode Minimum number of data points per node to continue splitting
    • int? maxDepth The maximum depth of each leaf
    • double? minInformationGain The minimum information gain to continue splitting
    • int? maxAttributes The maximum number of attributes to consider at each split
  • Models.Bayesian.MultinomialNaiveBayes TrainMultinomialNaiveBayes Multinomial naive bayes preserves the count of each feature within the model. Useful for long documents.
    • IReadOnlyList<(System.String Classification, BrightWire.Models.IndexList Data)> data The training data table
  • Models.Bayesian.BernoulliNaiveBayes TrainBernoulliNaiveBayes Bernoulli naive bayes treats each feature as either 1 or 0 - all feature counts are discarded. Useful for short documents.
    • IReadOnlyList<(System.String Classification, BrightWire.Models.IndexList Data)> data The training data table
  • Models.Bayesian.NaiveBayes TrainNaiveBayes Naive bayes is a classifier that assumes conditional independence between all features
  • ILinearRegressionTrainer CreateLinearRegressionTrainer Linear regression fits a line to a set of data that allows you predict future values
  • string GetBestClassification Finds the classification with the highest weight
    • IReadOnlyList<(System.String Label, System.Single Weight)> classifications List of weighted classifications
  • IRowClassifier ConvertToRowClassifier Converts the logistic regression classifier into a row classifier
    • ILogisticRegressionClassifier classifier Logistic regression classifier to convert
    • IReadOnlyList<int> attributeColumns Attribute columns in data table to use
    • string negativeLabel Output classification for negative class label
    • string positiveLabel Output classification for the positive class label

Models.FloatMatrix

A protobuf serialised matrix

Properties

  • Models.FloatVector[] Row The rows of the matrix
  • int RowCount The number of rows
  • int ColumnCount The number of columns
  • string Xml Converts the matrix to XML

Methods

  • Models.FloatMatrix Create Create a new float matrix with the specified rows
  • Models.FloatMatrix Create Create a new float matrix with the specified number of rows and columns initialised to zero
    • int rowCount Number of rows
    • int columnCount Number of columns
  • string ToString ToString override
  • void WriteTo Writes the data to an XML writer
    • string name The name to give the data
    • System.Xml.XmlWriter writer The writer to write to
  • void WriteTo Writes the data to a binary writer
    • System.IO.BinaryWriter writer
  • Models.FloatMatrix ReadFrom Creates a float matrix from a binary reader
    • System.IO.BinaryReader reader The binary reader
  • bool IsEqualTo Tests if the matrices are the same
    • Models.FloatMatrix matrix The matrix to compare
    • IEqualityComparer<float> comparer Optional IEqualityComparer to use

Models.FloatTensor

A protobuf serialised 3D tensor

Properties

  • Models.FloatMatrix[] Matrix The list of matrices that form the tensor
  • int RowCount The number of rows
  • int ColumnCount The number of columns
  • int Depth The depth of the tensor
  • string Xml Converts the tensor to XML
  • int Size Number of items in the tensor (depth * rows * columns)

Methods

  • Models.FloatTensor Create Create a new 3D tensor
    • Models.FloatMatrix[] matrices List of matrices that form the 3D tensor (each should have the same dimensions)
  • Models.FloatTensor Create Create a new 3D tensor initialised to zero
    • int rowCount Row count of each matrix
    • int columnCount Column count of each matrix
    • int depth Depth of the 3D tensor (number of matrices)
  • string ToString ToString override
  • void WriteTo Writes the data to an XML writer
    • string name The name to give the data
    • System.Xml.XmlWriter writer The writer to write to
  • void WriteTo Writes the data to a binary writer
    • System.IO.BinaryWriter writer
  • Models.FloatTensor ReadFrom Creates a float tensor from a binary reader
    • System.IO.BinaryReader reader The binary reader
  • float[] GetAsRaw Converts the data to a column major vector
  • bool IsEqualTo Tests if the tensors are the same
    • Models.FloatTensor tensor The tensor to compare
    • IEqualityComparer<float> comparer Optional IEqualityComparer to use

Models.FloatVector

An protobuf serialised vector

Properties

  • float[] Data The data
  • int Size (Same as Count) - The number of elements in the vector
  • int Count (Same as Size) - The number of elements in the vector
  • string Xml Converts the vector to XML

Methods

  • Models.FloatVector Create Create a new float vector with the specified data
    • float[] data
  • Models.FloatVector Create Create a new float vector with each entry set to zero
    • int size Size of the vector
  • string ToString ToString override
  • void WriteTo Writes the data to an XML writer
    • string name The name to give the data
    • System.Xml.XmlWriter writer The writer to write to
  • void WriteTo Writes the data to a binary writer
    • System.IO.BinaryWriter writer
  • Models.FloatVector ReadFrom Creates a float array from a binary reader
    • System.IO.BinaryReader reader The binary reader
  • bool IsEqualTo Tests if the vectors are the same
    • Models.FloatVector vector The vector to compare
    • IEqualityComparer<float> comparer Optional IEqualityComparer to use
  • int MaximumIndex Finds the index with the highest value

ExecutionGraph.GraphFactory.GradientDescentProvider

Prebuilt gradient descent optimisers

Properties

ExecutionGraph.GraphFactory.GraphActionProvider

Provides standard graph actions

Methods

  • IAction Constrain Constrains the signal through the graph (either forward or backward)
    • float min Minimum allowed value
    • float max Maximum allowed value

ExecutionGraph.GraphFactory

Creates graph nodes

Properties

Methods

  • void GraphFactory Constructor
  • void PushPropertySet Clones the current property set with an optional mutator and then pushes it onto the stack
    • System.Action<BrightWire.IPropertySet> mutator Callback that can modify the cloned property set
  • void PopPropertyStack Pops the last property set from the stack
  • IGradientDescentOptimisation CreateWeightUpdater Creates a gradient descent optimiser for the given matrix
  • IExecutionContext CreateExecutionContext Creates a graph execution context
  • ILearningContext CreateLearningContext Creates a graph learning context
    • float learningRate Initial learning rate
    • int batchSize Mini batch size
    • TrainingErrorCalculation trainingErrorCalculation How to calculate the training error
    • bool deferUpdates True to defer updates (used when training recurrent neural networks)
  • IGraphTrainingEngine CreateTrainingEngine Creates a graph training engine
    • IDataSource dataSource Data source with training data
    • float learningRate Initial learning rate
    • int batchSize Mini batch size
    • TrainingErrorCalculation trainingErrorCalculation How to calculate the training error
  • IGraphTrainingEngine CreateTrainingEngine Creates a graph training engine
  • IGraphTrainingEngine CreateTrainingEngine Creates a graph training engine
  • IGraphEngine CreateEngine Creates a graph execution engine
  • IDataSource CreateDataSource Creates a data source from a list of vectors
    • IReadOnlyList<BrightWire.Models.FloatVector> vectorList The list of vectors that will be the rows in the data source
  • IDataSource CreateDataSource Creates a data source from a list of matrices (sequential vectors)
    • IReadOnlyList<BrightWire.Models.FloatMatrix> sequenceList The list of matrices that will be the rows in the data source
  • IDataSource CreateDataSource Creates a data source from a list of tensors
    • IReadOnlyList<BrightWire.Models.FloatTensor> tensorList The list of tensors that will be the rows in the data source
  • IDataSource CreateDataSource Creates a data source from a data table
    • IDataTable dataTable The data table to convert
    • IDataTableVectoriser vectoriser Optional data table vectoriser (if the data table contains categorical or index based data)
  • IDataSource CreateDataSource Creates an adaptive data source (that uses the output from a preliminary graph)
    • IDataTable dataTable Data that will be sent to the preliminary graph
    • ILearningContext learningContext Learning context to use while training the preliminary graph
    • System.Action<BrightWire.ExecutionGraph.WireBuilder> dataConversionBuilder Callback to build the preliminary graph
  • IDataSource CreateDataSource Creates an adaptive data source from a serialised model
  • (BrightWire.INode RowClassifier, System.Int32 OutputSize) CreateClassifier Create a row classifier node
    • IRowClassifier classifier The classifier for each row
    • IDataTable dataTable The data table that contains the rows to classify (linked by mini batch index)
    • IDataTableAnalysis analysis Optional data table analysis data
    • string name Optional name to give the node
  • INode CreateFeedForward Creates a feed forward layer
    • int inputSize Number of incoming connections
    • int outputSize Number of outgoing connections
    • string name Optional name to give the node
  • INode CreateDropConnect Creates a new drop connect layer (a feed forward layer with drop out applied to the weights)
    • float dropoutPercentage Percentage of connections to drop (0..1)
    • int inputSize Number of incoming connections
    • int outputSize Number of outgoing connections
    • string name Optional name to give the node
  • INode CreateTiedFeedForward Creates a layer whose weights are shared with another layer (but transposed)
    • IFeedForward layer The layer that shares weights
    • string name Optional name to give the node
  • INode CreateConvolutional Creates a convolutional layer
    • int inputDepth Input depth
    • int filterCount Number of convolutional filters
    • int padding Padding to apply before convolutions
    • int filterWidth Width of each filter
    • int filterHeight Height of each filter
    • int stride Convolutional stride
    • bool shouldBackpropagate True to calculate the backpropagation error signal
    • string name Optional name to give the node
  • INode CreateMaxPool Creates a max pooling convolutional layer
    • int filterWidth
    • int filterHeight
    • int stride
    • string name Optional name to give the node
  • INode CreateSimpleRecurrent Creates a simple recurrent layer
    • int inputSize Number of incoming connections
    • float[] memory Size of the layer memory
    • INode activation Activation layer
    • string name Optional name to give the node
  • INode CreateElman Creates an Elman recurrent layer
    • int inputSize Number of incoming connections
    • float[] memory Size of the layer memory
    • INode activation First activation layer
    • INode activation2 Second activation layer
    • string name Optional name to give the node
  • INode CreateJordan Creates a Jordan recurrent layer
    • int inputSize Number of incoming connections
    • float[] memory Size of the layer memory
    • INode activation First activation layer
    • INode activation2 Second activation layer
    • string name Optional name to give the node
  • INode CreateOneMinusInput Creates a node that subtracts each input from 1 (1-x)
    • string name Optional name to give the node
  • INode CreateSequenceReverser Creates a node that outputs the reversed index of the current sequence (for bidirectional recurrent networks)
    • int index Input index to reverse
    • string name Optional name to give the node
  • INode CreateGru Creates a GRU recurrent layer
    • int inputSize Number of incoming connections
    • float[] memory Size of the layer memory
    • string name Optional name to give the node
  • INode CreateRan Creates a Recurrent Additive Layer (recurrent)
    • int inputSize Number of incoming connections
    • float[] memory Size of the layer memory
    • string name Optional name to give the node
  • INode CreateLstm Creates a LSTM recurrent layer
    • int inputSize Number of incoming connections
    • float[] memory Size of the layer memory
    • string name Optional name to give the node
  • INode CreateDropOut Creates a layer that drops random connections
    • float dropoutPercentage Percentage to drop (0..1)
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder Connect Builds a new wire from the engine's input node
  • ExecutionGraph.WireBuilder Connect Builds a new wire from the selected node
    • int inputSize Number of outgoing connections
    • INode node The node to build from
  • ExecutionGraph.WireBuilder Connect Builds a new wire from the selected node
    • int width Volume width
    • int height Volume height
    • int depth Volume depth
    • INode node The node to build from
  • ExecutionGraph.WireBuilder Add Adds the output of two wires into a new wire
  • ExecutionGraph.WireBuilder Subtract Subtracts the second input from the first input and sends the result to a new wire
  • ExecutionGraph.WireBuilder Subtract Subtracts the second input from the first input and sends the result to a new wire
    • int inputSize The number of connections
    • INode input1 The node to subtract from
    • INode input2 The node to subtract
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder Add Adds the output of two nodes together into a new wire
    • int inputSize The number of connections
    • INode input1 First node
    • INode input2 Second node
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder Multiply Multiplies the output of two wires into a new wire
  • ExecutionGraph.WireBuilder Multiply Multiplies the output of two nodes together into a new wire
    • int inputSize The number of connections
    • INode input1 First node
    • INode input2 Second node
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder Join Concatenates two wires together into a new wire
  • ExecutionGraph.WireBuilder ReverseTemporalJoin Concatenates two wires together into a new wire, but reverses the temporal index of the second input to realign with reversed sequences
  • INode CreateWrapper Wraps an existing node, enabling that node to be used at multiple locations in the same graph
    • INode nodeToWrap Node to wrap
    • string name Optional name to give the wrapping node
  • INode Create Creates a node from it's serialised model
  • INode LeakyReluActivation Creates a new leaky relu activation layer
    • string name Optional name to give the node
  • INode ReluActivation Creates a new relu activation layer
    • string name Optional name to give the node
  • INode SigmoidActivation Creates a new sigmoid activation layer
    • string name Optional name to give the node
  • INode TanhActivation Creates a new tanh activation layer
    • string name Optional name to give the node
  • INode SoftMaxActivation Creates a new softmax activation layer
    • string name Optional name to give the node
  • IWeightInitialisation ConstantWeightInitialisation Creates a constant weight initialiser
    • float biasValue Single bias value
    • float weightValue Single weight value
  • IWeightInitialisation GaussianWeightInitialisation Creates a gaussian weight initialiser
    • bool zeroBias True to set bias values to zero, otherwise bias initialisation is treated the same as weight initialisation
    • float stdDev Standard deviation of gaussian distribution
    • GaussianVarianceCalibration varianceCalibration How to calibrate the variance
    • GaussianVarianceCount varianceCount How to count connections while calibrating connections
  • IWeightInitialisation IdentityWeightInitialisation Creates an identity weight initialiser
    • float identityValue The value to give to each diagonal value
  • IWeightInitialisation XavierWeightInitialisation Creates a xavier weight initialiser
    • float parameter Xavier parameter
  • ICreateTemplateBasedGradientDescent AdaGrad Creates an AdaGrad gradient descent optimiser
  • ICreateTemplateBasedGradientDescent Adam Creates an Adam gradient descent optimiser
    • float decay Decay parameter
    • float decay2 Second decay parameter
  • ICreateGradientDescent L1 Creates a L1 regularisation gradient descent optimiser
    • float lambda L1 parameter
  • ICreateGradientDescent L2 Creates a L2 regularisation gradient descent optimiser
    • float lambda L2 parameter
  • ICreateTemplateBasedGradientDescent Momentum Creats a momentum gradient descent optimiser
    • float momentum Momentum parameter
  • ICreateTemplateBasedGradientDescent NesterovMomentum Creates a nesterov momentum gradient descent optimiser
    • float momentum Nesterov momentum parameter
  • ICreateTemplateBasedGradientDescent RmsProp Creates a rms prop gradient descent optimiser
    • float decay Rms decay

Models.GraphModel

A serialised graph

Properties

ExecutionGraph.GraphFactory.GraphOperationProvider

Provides standard graph operations

Methods

  • INode OneDividedBy Calculates inverse (1/x) of graph input
    • string name
  • INode InputSquared Calculates square (x^2) of graph input
    • string name
  • INode SquareRootOf Calculates square root of graph input
    • string name
  • INode OneMinusInput Caclculates one minus graph input (1-x)
    • string name

TrainingData.WellKnown.Mnist.Image

Image data

Properties

  • System.Byte[] Data The image data
  • int Label The image number (0-9)
  • (BrightWire.Models.FloatVector Data, BrightWire.Models.FloatVector Label) AsFloatArray Converts the image to one hot encoded float arrays
  • (BrightWire.Models.FloatTensor Tensor, BrightWire.Models.FloatVector Label) AsFloatTensor Converts the image to a tensor with one hot encoded label vector

Models.IndexList

A protobuf serialisable sparse array of indices

Properties

  • uint[] Index The list of indices
  • int Count The number of items in the list
  • string Xml Converts the index list to XML

Methods

  • Models.IndexList Create Create a new index list with the specified indices
    • uint[] index Sparse list of indices
  • string ToString ToString override
  • void WriteTo Writes the data to an XML writer
    • string name The name to give the data
    • System.Xml.XmlWriter writer The writer to write to
  • void WriteTo Writes the data to a binary writer
    • System.IO.BinaryWriter writer
  • Models.IndexList ReadFrom Creates an index list from a binary reader
    • System.IO.BinaryReader reader The binary reader

Models.InstanceBased.KNearestNeighbours

K Nearest Neighbour Model

Properties

  • Models.FloatVector[] Instance The list of vectors to match against
  • string[] Classification The corresponding list of classifications
  • int[] FeatureColumn The vector indexes to use to encode a data table row as a vector

Methods

  • IRowClassifier CreateClassifier Creates a classifier from this model
    • ILinearAlgebraProvider lap The linear algebra provider
    • int k The number of instances to consider
    • DistanceMetric distanceMetric The distance metric to compare each row with each instance

Models.LinearRegression

A linear regression model

Properties

Methods

Models.LogisticRegression

A logistic regression model

Properties

Methods

Models.Bayesian.MarkovModel2<T>

A markov model based on observing two items at a time

Properties

Models.Bayesian.MarkovModel3<T>

A markov model based on observing the last three observations

Properties

Models.Bayesian.MarkovModelObservation2<T>

A markov model observation based on the preceding two items

Properties

  • T Item1 The second last preceding item
  • T Item2 The last preceding item
  • List<BrightWire.Models.Bayesian.MarkovModelStateTransition<T>> Transition The list of possible transitions from this state

Methods

  • bool Equals Equals overide
    • object obj
  • int GetHashCode Hash code override

Models.Bayesian.MarkovModelObservation3<T>

A markov model observation based on the preceding three instances

Properties

  • T Item1 The third last item
  • T Item2 The second last item
  • T Item3 The third last item
  • List<BrightWire.Models.Bayesian.MarkovModelStateTransition<T>> Transition The list of associated transitions

Methods

  • bool Equals Equals override
    • object obj
  • int GetHashCode Hashcode override

Models.Bayesian.MarkovModelStateTransition<T>

A markov model state transition

Properties

  • T NextState The next state
  • float Probability The probability of this next state

ExecutionGraph.Helper.MiniBatch

Properties

  • IReadOnlyList<int> Rows
  • IDataSource DataSource
  • bool IsSequential
  • int BatchSize
  • IMiniBatchSequence CurrentSequence
  • bool HasNextSequence
  • int SequenceCount

Methods

  • void MiniBatch Creates a non sequential mini batch
    • IReadOnlyList<int> rows The indices of the rows in this mini batch
    • IDataSource dataSource Associated data source
    • IReadOnlyList<BrightWire.IGraphData> input Mini batch input data
    • IGraphData output Expected output data (when training, otherwise null)
  • void MiniBatch Creates a sequential mini batch
    • IReadOnlyList<int> rows The indices of the rows in this mini batch
    • IDataSource dataSource Associated data source
  • void Add Adds another item to the sequential mini batch
    • MiniBatchSequenceType type Type of the sequential item
    • IReadOnlyList<BrightWire.IGraphData> input Mini batch input data
    • IGraphData output Expected output data (when training, otherwise null)
  • void Reset
  • IMiniBatchSequence GetNextSequence
  • IMiniBatchSequence GetSequenceAtIndex
    • int index

TrainingData.WellKnown.Mnist

Helper class for MNIST data: http://yann.lecun.com/exdb/mnist/

Methods

  • IReadOnlyList<BrightWire.TrainingData.WellKnown.Mnist.Image> Load Loads a set of images from the MNIST data files
    • string labelPath Path to the label data file
    • string imagePath Path to the image data file
    • int total Maximum number of images to load

ExecutionGraph.Node.Gate.MultiGateBase

Base class for nodes that accept input on an arbitary number of channels and output a single signal

Methods

  • void ExecuteForward Executes on the primary channel
  • void ReadFrom
  • void WriteTo
    • System.IO.BinaryWriter writer

Models.MultinomialLogisticRegression

Multinomial logistic regression model

Properties

  • Models.LogisticRegression[] Model The list of logistic regression models
  • string[] Classification The associated classification labels
  • int[] FeatureColumn The columns used to build the dense input vectors

Methods

Models.Bayesian.MultinomialNaiveBayes

Multinomial naive bayes model

Properties

Methods

Models.Bayesian.NaiveBayes

A naive bayes model

Properties

  • List<BrightWire.Models.Bayesian.NaiveBayes.ClassSummary> Class A list of possible classifications and their data

Methods

Models.ExecutionGraph.Node

A node within the graph

Properties

  • string TypeName The .NET type name of the node type
  • string Id The unique id within the graph
  • string Name Node friendly name
  • string Description A short description of the node
  • System.Byte[] Data The node's parameters

Models.DecisionTree.Node

A node in the decision tree

Properties

  • Models.DecisionTree.Node[] Children The nodes children
  • int ColumnIndex The column index that is being split on
  • string MatchLabel The value to match this node
  • double? Split The value to split on
  • string Classification This node's classification label

Methods

  • void WriteTo Writes the node as XML
    • System.Xml.XmlWriter writer The XML writer

ExecutionGraph.Node.NodeBase

Base class for graph nodes

Properties

  • string Id The node's unique id
  • string Name The node's name in the graph
  • List<BrightWire.IWire> Output The list of outgoing wires along which the output signal will be sent
  • IEnumerable<BrightWire.INode> SubNodes The list of sub-nodes

Methods

  • void Dispose Disposal
  • void ExecuteForward Called when executing forward on the primary channel
  • void ExecuteForward Called when executing forward
  • Models.ExecutionGraph.Node SerialiseTo Serialise this node and any connected nodes
    • HashSet<BrightWire.INode> existing Set of nodes that have already been serialised in the current context
    • List<BrightWire.Models.ExecutionGraph.Node> connectedTo List of nodes this node is connected to
    • HashSet<BrightWire.Models.ExecutionGraph.Wire> wireList List of wires between all connected nodes
  • void OnDeserialise Called after the graph has been completely deserialised
    • IReadOnlyDictionary<System.String, BrightWire.INode> graph The complete graph
  • void WriteTo Serialise the node
    • System.IO.BinaryWriter writer Binary writer
  • void ReadFrom Deserialise the node
  • INode FindByName Finds a connected node by friendly name
    • string name The node's name to search for
  • INode FindById Finds a connected node by id
    • string id Unique id to find
  • void LoadParameters Loads parameters into an existing node

TrainingData.Artificial.Or

Simple OR training data

Methods

  • IDataTable Get Generates a data table containing OR training data

Models.RandomForest

A random forest model

Properties

Methods

TrainingData.Artificial.ReberGrammar

Generates Reber grammar sequences: https://www.willamette.edu/~gorr/classes/cs449/reber.html

Properties

  • int Size The number of REBER characters

Methods

  • System.Char GetChar Gets the character at the specified index
    • int index Index to query
  • int GetIndex Gets the index for the specified character
    • System.Char ch The character to query
  • Models.FloatMatrix Encode Encodes a reber sequence as a sequence of one hot encoded vectors
    • string sequence The reber sequence to encode
  • IDataTable GetOneHot One hot encodes the REBER strings
    • IEnumerable<string> strList A list of REBER sequences
  • void ReberGrammar Creates a reber grammar builder
    • bool stochastic True to generate random sequences
  • IEnumerable<string> Get Generates an unlimited number of reber sequences
    • int? minlength Minimum length of the sequences (optional)
    • int? maxLength Mimimum length of the sequences (optional)
  • IEnumerable<string> GetExtended Generates an unlimited number of extended reber sequences
    • int? minlength Minimum length of the sequences (optional)
    • int? maxLength Mimimum length of the sequences (optional)

ExecutionGraph.GraphFactory.RegularisationProvider

Prebuilt regularisation

Properties

ExecutionGraph.Helper.MiniBatch.Sequence

Properties

TrainingData.Artificial.SequenceGenerator

Generates random alphabetical sequences

Properties

  • int DictionarySize The number of letters to use

Methods

  • void SequenceGenerator Constructor
    • int dictionarySize The number of letters to use
    • int minSize The minimum size of each sequence
    • int maxSize The maximum size of each sequence
    • bool noRepeat True to avoid repeating any previous character within each sequence
    • bool isStochastic True to generate different sequences each time
  • string NextSequence Generates a new sequence
  • Models.FloatVector Encode Converts the character to a one hot encoded vector
    • System.Char ch
    • float val
  • Models.FloatVector Encode Encodes the characters as a dense vector
    • IEnumerable<(System.Char, System.Single)> data
  • Models.FloatMatrix Encode Encodes the string as a list of dense vectors within a matrix (each character becomes a row in the matrix)
    • string str
  • IEnumerable<string> GenerateSequences Generator function to generate new sequences

TrainingData.Helper.SequenceWindowBuilder

Creates a new training feature vector using a window of surrounding features at each point in the input sequence

Properties

  • int OutputSize The size of the generated training data

Methods

  • void SequenceWindowBuilder Creates a new sequence window builder
    • int before The number of previous items to include before each item
    • int after The number of following items to include after each item
  • IReadOnlyList<float[]> Get Augments a single sequence
    • IReadOnlyList<float[]> data The sequence to analyse

TrainingData.Helper.SimpleTokeniser

Finds strings of words and numbers in a larger string

Methods

  • IEnumerable<string> Tokenise Splits the text into smaller word and number strings. Punctuation characters become single character strings.
    • string text The text to tokenise
  • IEnumerable<string> JoinNegations Simple token modification following "not". Double not or punctuation stops the not mode
    • IEnumerable<string> tokenList The list of tokens
  • IEnumerable<IReadOnlyList<string>> FindSentences Finds sentences from a list of strings
    • IEnumerable<string> stringList The list of strings
  • bool IsEndOfSentence Checks if the string is an end of sentence token
    • string str The string to check

TrainingData.SimpleTokeniser

Finds strings of words and numbers in a larger string

Methods

  • IEnumerable<string> Tokenise Splits the text into smaller word and number strings. Punctuation characters become single character strings.
    • string text The text to tokenise
  • IEnumerable<string> JoinNegations Simple token modification following "not". Double not or punctuation stops the not mode
    • IEnumerable<string> tokenList The list of tokens
  • IEnumerable<IReadOnlyList<string>> FindSentences Finds sentences from a list of strings
    • IEnumerable<string> stringList The list of strings
  • bool IsEndOfSentence Checks if the string is an end of sentence token
    • string str The string to check

ExecutionGraph.SingleBackpropagationBase<T>

Base class for nodes that back propagate to a single parent

Methods

  • void _Backward Called when a valid error signal has been received
    • INode fromNode The node that sent the backpropagation signal
    • IGraphData errorSignal The backpropagating error
    • IContext context Graph context
    • IReadOnlyList<BrightWire.INode> parents Parents of the current node

Models.Bayesian.BernoulliNaiveBayes.StringIndexProbability

The probabilities associated with a string index

Properties

  • uint StringIndex The string index
  • double ConditionalProbability The log of the conditional probability
  • double InverseProbability The log of the inverse conditional probability

Models.Bayesian.MultinomialNaiveBayes.StringIndexProbability

The conditional probability associated with a string index

Properties

  • uint StringIndex The string index
  • double ConditionalProbability The conditional probability

Models.StringTable

An array of indexed strings

Properties

  • string[] Data The array of indexed strings

TrainingData.Helper.StringTableBuilder

Assigns string indices to strings

Properties

  • Models.StringTable StringTable Serialises the string table
  • uint Size Returns the size of the string table

Methods

  • void StringTableBuilder Creates an empty string table builder
  • void StringTableBuilder Creates a string table builder pre populated with an existing string table
  • void StringTableBuilder Creates a string table builder pre populated with an existing string table
    • string[] stringTable The string table to pre populate
  • bool TryGetIndex Returns true if the string has already been added
    • string str The string to check
    • uint ret The string index
  • uint GetIndex Gets a string index for a string (creates a new index if not found)
    • string str The string to look up
  • string GetString Returns the string at the specified index
    • uint index The string index

TrainingData.StringTableBuilder

Assigns string indices to strings

Properties

  • Models.StringTable StringTable Serialises the string table
  • uint Size Returns the size of the string table

Methods

  • void StringTableBuilder Creates an empty string table builder
  • void StringTableBuilder Creates a string table builder pre populated with an existing string table
  • void StringTableBuilder Creates a string table builder pre populated with an existing string table
    • string[] stringTable The string table to pre populate
  • bool TryGetIndex Returns true if the string has already been added
    • string str The string to check
    • uint ret The string index
  • uint GetIndex Gets a string index for a string (creates a new index if not found)
    • string str The string to look up
  • string GetString Returns the string at the specified index
    • uint index The string index

ExecutionGraph.Helper.TrainingAction

Properties

Methods

  • void TrainingAction Creates a training action history from a single optional parent
    • INode source The node that executed
    • IGraphData data The output of the node
    • INode parent The single parent that contributed to the output (optional)
  • void TrainingAction Creates a training action history from multiple parents
    • INode source The node that executed
    • IGraphData data The output of the node
    • IReadOnlyList<BrightWire.INode> parents The parent nodes that contributed to the output

Source.Helper.VectorDistanceHelper

Calculates the distance between a list of vectors and a list of vectors to compare against

Properties

  • IReadOnlyList<BrightWire.IVector> CompareTo The list of vectors to compare against

Methods

  • void VectorDistanceHelper Constructor
  • int AddComparison Adds a comparison vector (will be owned and disposed by the helper class)
    • IVector comparison Vector to compare against
  • void UpdateComparisonVector Updates the comparison vector at this index (disposes the old vector)
    • int index Index to update
    • IVector newVector Vector to replace with
  • void SetComparisonVectors Updates the entire list of comparison vectors
    • IReadOnlyList<BrightWire.IVector> comparisonVectors List of vectors to compare against
  • IReadOnlyList<int> GetClosest Returns the index of the closest comparison vector for each vector
  • IVector GetAverageFromData Returns a vector averaged from the data vectors
    • IReadOnlyList<int> indices Indices of the data vectors to use in the averaged vector

Models.WeightedIndexList.WeightedIndex

A weighted index

Properties

  • uint Index Index
  • float Weight Index weight

Models.WeightedIndexList

A protobuf serialisable sparse array of weighted indices

Properties

Methods

  • Models.WeightedIndexList Create Create a new weighted index list with the specified weighted indices
  • string ToString ToString override
  • void WriteTo Writes the data to an XML writer
    • string name The name to give the data
    • System.Xml.XmlWriter writer The writer to write to
  • void WriteTo Writes the data to a binary writer
    • System.IO.BinaryWriter writer
  • Models.WeightedIndexList ReadFrom Creates a weighted index list from a binary reader
    • System.IO.BinaryReader reader The binary reader

ExecutionGraph.GraphFactory.WeightInitialisationProvider

Prebuilt weight initialisers

Properties

Models.ExecutionGraph.Wire

Wires connect nodes (aka edges)

Properties

  • string FromId The source node id
  • string ToId The target node id
  • int InputChannel The channel on the target node to send the source node's output

Methods

  • string ToString
  • int GetHashCode
  • bool Equals
    • object obj

ExecutionGraph.WireBuilder

Wires nodes together to build strands of a graph

Properties

  • int CurrentSize The current wire size
  • INode LastNode The last added node

Methods

  • void WireBuilder Connects new nodes starting from the specified node
  • void WireBuilder Connects new nodes starting from the specified node
    • ExecutionGraph.GraphFactory factory Graph factory
    • int width Initial input width
    • int height Initial input height
    • int depth Initial input depth
    • INode node The node to build from
  • void WireBuilder Connects new nodes to the engine output node
  • ExecutionGraph.WireBuilder SetNewSize Changes the current size of the builder
    • int newSize New wire builder size
  • ExecutionGraph.WireBuilder IncrementSizeBy Changes the current wire's input size
    • int delta Amount to add to the current wire size
  • ExecutionGraph.WireBuilder AddClassifier Connects a row classifier
  • ExecutionGraph.WireBuilder AddFeedForward Adds a feed forward layer
    • int outputSize Number of outgoing connections
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder AddTiedFeedForward Adds a feed forward layer whose weights are tied to a previous layer
    • IFeedForward layer The layer whose weights are tied
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder AddDropOut Adds a drop out layer
    • float dropOutPercentage Percentage of connections to drop
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder AddDropConnect
    • float dropOutPercentage Percentage of connections to drop
    • int outputSize Number of outgoing connections
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder Add Adds a node
  • ExecutionGraph.WireBuilder AddForwardAction Adds an action that will be executed in the forward pass
    • IAction action Action to execute
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder AddBackwardAction Adds an action that will be executed in the backward pass
    • IAction action Action to execute
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder AddSimpleRecurrent Adds a simple recurrent neural network layer
    • INode activation Activation layer
    • float[] initialMemory Initial memory
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder AddElman Adds an Elman recurrent neural network layer
    • INode activation First activation layer
    • INode activation2 Second activation layer
    • float[] initialMemory Initial memory
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder AddJordan Adds a Jordan recurrent neural network layer
    • INode activation First activation layer
    • INode activation2 Second activation layer
    • float[] initialMemory Initial memory
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder AddGru Adds a gated recurrent unit recurrent neural network layer
    • float[] initialMemory Initial memory
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder AddRan Adds a recurrent additive layer (recurrent)
    • float[] initialMemory Initial memory
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder AddLstm Adds a long short term memory recurrent neural network layer
    • float[] initialMemory Initial memory
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder ReverseSequence Adds a node that will reverse the sequence (for bidirectional recurrent neural networks)
    • int index Input index to reverse
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder AddMaxPooling Adds a max pooling convolutional layer
    • int filterWidth Width of max pooliing filter
    • int filterHeight Height of max pooling filter
    • int stride Filter stride
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder AddConvolutional Adds a convolutional layer
    • int filterCount Number of filters in the layer
    • int padding Padding to add before applying the convolutions
    • int filterWidth Width of each filter
    • int filterHeight Height of each filter
    • int stride Filter stride
    • bool shouldBackpropagate True to calculate a backpropagation signal
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder Transpose Transposes the graph signal to move between convolutional and non-convolutional layers
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder TransposeAndCombine Transposes the graph signal and merges each depth slice
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder AddBackpropagation Adds backpropagation - when executed an error signal will be calculated and flow backwards to previous nodes
    • IErrorMetric errorMetric Error metric to calculate the error signal
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder AddBackpropagationThroughTime Adds backpropagation through time
    • IErrorMetric errorMetric Error metric to calculate the error signal
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder ConstrainForwardSignal Constrains the error signal in the forward direction
    • float min Minimum allowed value
    • float max Maximum allowed value
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder ConstrainBackwardSignal Constrains the error signal in the backward direction
    • float min Minimum allowed value
    • float max Maximum allowed value
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder WriteNodeMemoryToSlot Writes node memory to a named memory slot
    • string slotName Memory slot name
    • IHaveMemoryNode node The node to read
    • string name Optional name to give the node
  • ExecutionGraph.WireBuilder JoinInputWithMemory Concatenates the named memory slot with the input signal
    • string slotName Memory slot name
    • string name Optional name to give the node
  • INode Find Tries to find the specified node
    • string name The friendly name of the node

ExecutionGraph.Helper.WireToNode

Properties

  • INode SendTo
  • int Channel

Methods

  • void WireToNode Constructor
    • INode node The destination node
    • int channel The input channel on the node

TrainingData.Artificial.Xor

Simple XOR training data

Methods

  • IDataTable Get Generates a data table containing XOR training data

I3DTensor

A list of matrices

Properties

  • int RowCount The number of rows in each matrix
  • int ColumnCount The number of columns in each matrix
  • int Depth The number of matrices
  • Models.FloatTensor Data Converts the current tensor to protobuf format

Methods

  • IMatrix GetMatrixAt Returns a matrix at the specified depth
    • int depth The depth to query
  • IIndexable3DTensor AsIndexable Returns an indexable 3D tensor
  • I3DTensor AddPadding Adds padding to each matrix
    • int padding The padding (both vertical and horizontal)
  • I3DTensor RemovePadding Removes padding from each matrix
    • int padding The padding to remove
  • IMatrix Im2Col Performs a convolution on each source matrix
    • int filterWidth The filter width
    • int filterHeight The filter height
    • int stride The convolution stride
  • IVector ReshapeAsVector Converts the tensor to a vector
  • IMatrix ReshapeAsMatrix Converts the tensor to a matrix (each depth slice becomes a column in the new matrix)
  • I4DTensor ReshapeAs4DTensor Reshapes the 3D tensor into a 4D tensor (the current depth becomes the count of 3D tensors and columns becomes the new depth)
    • int rows Rows in each 4D tensor
    • int columns Columns in each 4D tensor
  • (BrightWire.I3DTensor Result, BrightWire.I3DTensor Indices) MaxPool Performs a max pooling operation on the tensor
    • int filterWidth The pooling filter width
    • int filterHeight The pooling filter height
    • int stride The pooling stride
    • bool saveIndices True to save the indices for a future reverse max pool operation
  • I3DTensor ReverseMaxPool Reverses a max pooling operation
    • I3DTensor indices A tensor that contains the indices of each maximum value that was found per filter
    • int outputRows Input rows
    • int outputColumns Input columns
    • int filterWidth Width of each filter
    • int filterHeight Height of each filter
    • int stride Filter stride
  • I3DTensor ReverseIm2Col Reverses a im2col operation
    • IMatrix filter The rotated filters
    • int outputRows Rows of the input tensor
    • int outputColumns Columns of the input tensor
    • int outputDepth Depth of the input tensor
    • int filterWidth Width of each filter
    • int filterHeight Height of each filter
    • int stride Filter stride
  • IMatrix CombineDepthSlices Adds each depth slice into a single matrix
  • void AddInPlace Adds the other tensor to the current tensor
  • I3DTensor Multiply Multiplies the tensor with the other matrix
    • IMatrix matrix Matrix to multiply with
  • void AddToEachRow Adds the vector to each row of the tensor
    • IVector vector Vector to add to each row
  • I3DTensor TransposeThisAndMultiply Transpose each sub matrix in the current tensor before multiplying it with each each sub tensor (converted to a matrix)

I4DTensor

A list of 3D tensors

Properties

  • int RowCount The number of rows in each 3D tensor
  • int ColumnCount The number of columns in each 3D tensor
  • int Depth The depth of each 3D tensor
  • int Count The count of 3D tensors
  • IReadOnlyList<BrightWire.Models.FloatTensor> Data Converts the current tensor to protobuf format

Methods

  • I3DTensor GetTensorAt Returns the tensor at the specified index
    • int index The index to query
  • IIndexable4DTensor AsIndexable Returns an indexable list of 3D tensors
  • I4DTensor AddPadding Adds padding to the 4D tensor
    • int padding Padding to add to the left, top, right and bottom edges of the tensor
  • I4DTensor RemovePadding Removes padding from the 4D tensor
    • int padding Padding to remove from the left, top, right and bottom edges of the tensor
  • (BrightWire.I4DTensor Result, BrightWire.I4DTensor Indices) MaxPool Applies a max pooling operation to the current tensor
    • int filterWidth Max pool filter width
    • int filterHeight Max pool filter height
    • int stride Filter stride
    • bool saveIndices True to save the indices for a future reverse pool operation
  • I4DTensor ReverseMaxPool Reverses a max pool operation
    • I4DTensor indices Tensor of indices from MaxPool operation
    • int outputRows Input tensor rows
    • int outputColumns Input tensor columns
    • int filterWidth
    • int filterHeight
    • int stride
  • I3DTensor Im2Col Applies the convolutional filter to each 3D tensor, producing a 3D tensor which can be multipled by the filter matrix
    • int filterWidth Filter width
    • int filterHeight Filter height
    • int stride Filter stride
  • I4DTensor ReverseIm2Col Reverse a previously applied im2Col
    • IMatrix filter List of filters that have been rotated 180 degrees
    • int outputRows Rows of the input 4D tensor
    • int outputColumns Columns of the input 4D tensor
    • int outputDepth Depth of the input 4D tensor
    • int filterWidth Filter width
    • int filterHeight Filter height
    • int stride Filter stride
  • IVector ColumnSums Sums the columns of each sub-tensor's sub matrix
  • IVector ReshapeAsVector Converts the tensor to a vector
  • IMatrix ReshapeAsMatrix Converts the tensor to a matrix (each 3D tensor becomes a column in the new matrix)

IAction

An action to perform when a signal reaches a node

Methods

  • IGraphData Execute Executes the action
  • string Serialise Serialises the action to a string
  • void Initialise Initialises the action
    • string data Previously serialised data

IAdaptiveDataSource

Adaptive data sources apply the output from a preliminary graph

Properties

  • INode AdaptiveInput The input node of the preliminary graph

Methods

  • Models.DataSourceModel GetModel Gets the serialised preliminary graph
    • string name Optional name to give the data source

IBackpropagation

Backpropagation handler

Methods

  • void Backward Backpropagate
    • INode fromNode Node that sent the signal
    • IGraphData errorSignal Error signal
    • IContext context Graph context
    • IReadOnlyList<BrightWire.INode> parents The current node's parents

ICanInitialiseNode

Interface that allows the node to be initialised

Methods

  • void Initialise Initialise the node
    • ExecutionGraph.GraphFactory factory Graph factory
    • string id Node unique id
    • string name Friendly name
    • string description Node description
    • System.Byte[] data Serialisation data

ICanSerialise

Serialisation interface for graph components

Methods

  • void WriteTo Writes the node state to the binary writer
    • System.IO.BinaryWriter writer
  • void ReadFrom Reads the node state

ICanSerialiseToStream

Standard serialisation interface

Methods

  • void SerialiseTo Writes the current object state to the stream
    • System.IO.Stream stream Stream to write to
  • void DeserialiseFrom Reads the current object state from the stream
    • System.IO.Stream stream Stream to read from
    • bool clear True to clear the existing state

IColumn

A column within a data table

Properties

  • int Index The index of the column within the data table
  • string Name The name of the column
  • ColumnType Type The data type
  • int NumDistinct The number of distinct values
  • bool IsContinuous True if the value is continuous (not categorical)
  • bool IsTarget True if the column is a classification target (or label)
  • int? DimensionX Optional x dimension of the column (vector size, matrix/tensor columns)
  • int? DimensionY Optional y dimension of the column (matrix/tensor rows)
  • int? DimensionZ Option z dimension of the column (tensor depth)

IColumnInfo

Column statistics within a data table

Properties

  • int ColumnIndex The index of the column in the data table
  • IEnumerable<object> DistinctValues The distinct values within the column
  • int? NumDistinct The number of distinct values (or null if there are too many)

IContext

Graph context

Properties

  • bool IsTraining True if the graph is currently training
  • INode Source Node that sent the current signal
  • IGraphData Data Current signal
  • IExecutionContext ExecutionContext Current execution context
  • ILearningContext LearningContext Current learning context (optional)
  • ILinearAlgebraProvider LinearAlgebraProvider Linear algebra provider
  • IMiniBatchSequence BatchSequence Current mini batch sequence
  • IGraphData ErrorSignal Current error signal
  • bool HasNext Checks if there is a pending forward graph operation

Methods

  • void AddForward Records node execution
    • IExecutionHistory action Record of node execution
    • System.Func<BrightWire.IBackpropagation> callback Optional callback to add backpropagation
  • void AddBackward Sends a backward error signal
    • IGraphData errorSignal Error signal
    • INode target Node to send to
    • INode source Node that sent the error
  • void AppendErrorSignal Records an error signal against a node
  • void Backpropagate Backpropagates the signal
  • bool ExecuteNext Executes the next pending forward graph operation

IConvertToType

Interface to convert between types

Methods

  • (System.Object convertedValue, System.Boolean wasSuccessful) ConvertValue Converts an object from one type to another
    • object value The value to convert

ICreateGradientDescent

Creates a gradient descent optimisation

Methods

ICreateTemplateBasedGradientDescent

Creates gradient descent optimisations based on a matrix

Methods

IDataSource

Data sources feed data into a graph

Properties

  • bool IsSequential True if the data is sequential
  • int InputSize The size of the input data
  • int OutputSize The size of the output data
  • int InputCount The number of inputs that can feed into the graph
  • int RowCount Number of rows

Methods

  • IMiniBatch Get Gets a mini batch with the specified rows
    • IExecutionContext executionContext Graph execution context
    • IReadOnlyList<int> rows List of rows
  • IReadOnlyList<IReadOnlyList<int>> GetBuckets For sequential data, returns the row indexes grouped by sequence length
  • void OnBatchProcessed Called when the current batch has completed
  • IDataSource CloneWith Creates a new data source, using the current as a template but replacing the data table

IDataTable

Tabular data table

Properties

  • int RowCount The number of rows
  • int TargetColumnIndex The column of the classification target (defaults to the last column if none set)
  • string XmlPreview Returns table meta-data and the top 20 rows of the table as XML
  • bool HasCategoricalData Returns true if the data table contains any non-numeric columns

Methods

  • void Process Applies each row of the table to the specified processor
  • IDataTableAnalysis GetAnalysis Data table statistics
  • void ForEach Invokes the callback on each row in the table
    • System.Action<BrightWire.IRow> callback Callback that is invoked for each row
  • void ForEach Invokes the callback on each row in the table
    • System.Action<BrightWire.IRow, System.Int32> callback Callback that is invoked for each row
  • void ForEach Invokes the callback on each row in the table
    • System.Func<BrightWire.IRow, System.Boolean> callback Callback that is invoked for each row and returns true to continue processing
  • IReadOnlyList<BrightWire.IRow> GetSlice Gets a list of rows
    • int offset The first row index
    • int count The number of rows to query
  • IReadOnlyList<BrightWire.IRow> GetRows Gets a list of rows
    • IReadOnlyList<int> rowIndex A sequence of row indices
  • IReadOnlyList<BrightWire.IRow> GetRows Gets a list of rows
    • IEnumerable<int> rowIndex A sequence of row indices
  • IRow GetRow Returns the row at the specified index
    • int rowIndex The row index to retrieve
  • (BrightWire.IDataTable Training, BrightWire.IDataTable Test) Split Splits the table into two random tables
    • int? randomSeed Optional random seed
    • double trainingPercentage The size of the training table (expressed as a value between 0 and 1)
    • bool shuffle True to shuffle the table before splitting
    • System.IO.Stream output1 Optional stream to write the first output table to
    • System.IO.Stream output2 Optional stream to write the second output table to
  • IDataTable Normalise Creates a normalised version of the current table
    • NormalisationType normalisationType The type of normalisation to apply
    • System.IO.Stream output Optional stream to write the normalised table to
    • IEnumerable<int> columnIndices Optional list of column indices to normalise
  • IDataTable Normalise Creates a normalised version of the current table
  • Models.DataTable.DataTableNormalisation GetNormalisationModel Builds a normalisation model from the table that can be used to normalise data to the same scale
    • NormalisationType normalisationType The type of normalisation
    • IEnumerable<int> columnIndices Optional list of column indices to normalise
  • IReadOnlyList<T> GetColumn Gets a column from the table
    • int columnIndex The column to retrieve
  • IDataTable Bag Creates a new data table with bagged rows from the current table
    • int? count The count of rows to bag
    • System.IO.Stream output Optional stream to write the new table to
    • int? randomSeed Optional random seed
  • IReadOnlyList<float[]> GetNumericRows Converts rows to lists of floats
    • IEnumerable<int> columns Optional list of columns to convert (or null for all columns)
  • IReadOnlyList<float[]> GetNumericColumns Gets each specified column (or all columns) as an array of floats
    • IEnumerable<int> columns The columns to return (or null for all)
  • IReadOnlyList<(BrightWire.IRow Row, System.String Classification)> Classify Classifies each row
    • IRowClassifier classifier The classifier to use
    • System.Action<float> progress Optional callback that is notified about classification progress
  • IDataTable SelectColumns Creates a new data table with the specified columns
    • IEnumerable<int> columns The columns to include in the new table
    • System.IO.Stream output Optional stream to write the new table to
  • IDataTable Project Creates a new data table with a projection of each existing row
    • System.Func<BrightWire.IRow, System.Collections.Generic.IReadOnlyList<object>> mutator Function that mutates each row into the new format
    • System.IO.Stream output Optional stream to write the new table to
  • IDataTable Filter Creates a new data table with only those rows that match the specified filter
    • System.Func<BrightWire.IRow, System.Boolean> filter Function that filters each row
    • System.IO.Stream output Optional stream to write the new table to
  • IEnumerable<(BrightWire.IDataTable Training, BrightWire.IDataTable Validation)> Fold Folds the data table into k buckets
    • int k Number of buckets to create
    • int? randomSeed Optional random seed
    • bool shuffle True to shuffle the table before folding
  • IReadOnlyList<(BrightWire.IDataTable Table, System.String Classification)> ConvertToBinaryClassification For each classification label - duplicate each data table except for the classification column which is converted to a boolean (true for each matching example)
  • IReadOnlyList<T> Map Mutates each row of the table
    • System.Func<BrightWire.IRow, T> mutator The function called for each row in the table
  • IDataTableVectoriser GetVectoriser Returns an interface that can convert rows in the current table to vectors
    • bool useTargetColumnIndex True to separate the target column index into a separate output vector
  • IDataTableVectoriser GetVectoriser Returns an interface that can convert rows in the current table to vectors
  • IDataTable CopyWithRows Returns a copy of the current table
    • IEnumerable<int> rowIndex The list of rows to copy
    • System.IO.Stream output Optional stream to write the new table to
  • IDataTable Zip Creates a new data table with each row of this data table zipped with the corresponding row of the other data table
    • IDataTable dataTable The data table whose rows are zipped
    • System.IO.Stream output Optional stream to write the new table to
  • void WriteTo Writes the data table to a stream
    • System.IO.Stream stream The stream to write to
  • void WriteIndexTo Writes the data table's index to a stream
    • System.IO.Stream stream The stream to write to
  • float Reduce Applies a function against each row in the data table to reduce the table to a single value
    • System.Func<BrightWire.IRow, System.Single, System.Single> reducer The function that is applied to each row
    • float initialValue Initial value passed to the function
  • float Average Finds an average value from applying the reducer to each row of the table
    • System.Func<BrightWire.IRow, System.Single> reducer Function that reduces each row to a single value
  • IDataTable ChangeColumnTypes Returns a new data table with columns converted to new types
    • Dictionary<System.Int32, BrightWire.IConvertToType> columnConversion Dictionary of columns to convert
    • bool removeInvalidRows True to remove rows that fail conversion
  • IDataTable Summarise Creates a summarised version of the data table
    • int newRowCount Number of rows to create in the summary table
    • System.IO.Stream output Optional stream to write the new table to
    • ISummariseRows summariser A row summariser that will summarise groups of rows (optional)

IDataTableAnalysis

Data table statistics

Properties

  • IEnumerable<BrightWire.IColumnInfo> ColumnInfo List of column statistics
  • IColumnInfo this Gets the statistics for a particular column
  • string AsXml Returns a summary of the table analysis

IDataTableBuilder

Used to programatically construct data tables

Properties

  • IReadOnlyList<BrightWire.IColumn> Columns The list of columns
  • int RowCount The number of rows
  • int ColumnCount The number of columns

Methods

  • IColumn AddColumn Adds a new column to the data table
    • ColumnType column The data type of the new column
    • string name The name of the new column
    • bool isTarget True if the column is a classification target
  • IColumn AddVectorColumn Adds a vector columns to the data table
    • int size The size of each vector
    • string name New column name
    • bool isTarget True if the column is a classification target
  • IColumn AddMatrixColumn Adds a matrix column to the data table
    • int rows Rows in each matrix
    • int columns Columns in each matrix
    • string name New column name
    • bool isTarget True if the column is a classification target
  • IColumn AddTensorColumn Adds a 3D tensor column to the data table
    • int rows Rows in each tensor
    • int columns Columns in each tensor
    • int depth Depth of each tensor
    • string name New column name
    • bool isTarget True if the column is a classification target
  • IRow Add Adds a new row to the table
    • object[] data The data in the new row
  • IRow Add Adds a new row to the table
    • IReadOnlyList<object> data The data in the new row
  • IDataTable Build Creates the new data table
  • void Flush Ensures all data has been written
  • void WriteIndexTo Writes the index data to the specified stream
    • System.IO.Stream stream The stream to hold the index data

IDataTableVectoriser

Converts data table rows to vectors

Properties

  • int InputSize The size of the input vector
  • int OutputSize The size of the output vector

Methods

  • Models.FloatVector GetInput Vectorises the input columns of the specified row
    • IRow row The row to vectorise
  • Models.FloatVector GetOutput Vectorises the output column of the specified row
    • IRow row The row to vectorise
  • string GetOutputLabel Returns the classification label
    • int columnIndex The data table column index
    • int vectorIndex The one hot vector index
  • Models.DataTable.DataTableVectorisation GetVectorisationModel Gets the serialisable model to recreate this vectorisation

IErrorMetric

Error metrics used to quantify machine learning

Properties

  • bool DisplayAsPercentage True if the result should be formatted as a percentage

Methods

  • float Compute Computes the error between the output vector and target vector
  • IMatrix CalculateGradient Calculates the gradient of the error function
    • IContext context The graph context
    • IMatrix output The mini batch of output vectors
    • IMatrix targetOutput The mini batch of expected target vectors

IExecutionContext

Graph execution context

Properties

  • ILinearAlgebraProvider LinearAlgebraProvider Linear algebra provider
  • int RemainingOperationCount How many operations remain queued
  • bool HasContinuations True if there are registered continuations

Methods

  • void SetMemory Writes to a named memory slot
    • string slotName Slot name
    • IMatrix memory Data
  • IMatrix GetMemory Reads from a named memory slot
    • string slotName Slot name
  • IGraphOperation GetNextOperation Gets the next queued graph operation (if any)
  • void Add Adds a list of graph operations to the queue
    • IReadOnlyList<BrightWire.IGraphOperation> operationList List of operations
  • void RegisterContinuation Registers a continuation that will be executed after the current sequence has been processed in full
    • IMiniBatchSequence sequence Sequence index
    • System.Action<BrightWire.IContext> callback Continuation
  • void Continue Execute any registered continuation for this context
    • IContext context Context with an associated IMiniBatchSequence

IExecutionHistory

Record of node execution

Properties

  • INode Source Node that was executed
  • IReadOnlyList<BrightWire.INode> Parents The node's parents
  • IGraphData Data Node output signal
  • IBackpropagation Backpropagation Optional backpropagation

IFeedForward

Feed forward layer

Properties

  • int InputSize Size of incoming connections
  • int OutputSize Size of outgoing connections
  • IVector Bias Bias vector
  • IMatrix Weight Weight matrix

Methods

  • void UpdateWeights Updates the weights

IGpuLinearAlgebraProvider

Helper methods when using the GPU linear algebra provider

Properties

  • System.Int64 FreeMemory Amount of free memory on the device in bytes
  • System.Int64 TotalMemory Amount of total memory on the device in bytes

Methods

  • void BindThread Binds the current thread to the cuda context (when using the same cuda provider from multiple threads)

IGradientDescentOptimisation

Gradient descent optimisation

Methods

  • void Update Updates the matrix with the delta

IGraphData

Wrapper around the data that is used as a signal between nodes in the graph

Properties

  • int Rows Row count
  • int Columns Column count
  • int Depth 3D Tensor depth (1 if the signal is a matrix)
  • int Count Count of 3D tensors (1 of the signal is a matrix or 3D tensor)

Methods

  • IMatrix GetMatrix Gets the signal as a matrix
  • I4DTensor Get4DTensor Gets the signal as a 4D tensor
  • IGraphData ReplaceWith Replaces the data with the specified matrix (but preserves any tensor meta data)
    • IMatrix matrix The matrix to use as a replacement
  • IReadOnlyList<BrightWire.IMatrix> GetSubMatrices Returns the list of matrices that compose the signal (single item if the signal is a matrix)

IGraphEngine

Graph engines drive execution within a graph

Properties

Methods

  • IReadOnlyList<BrightWire.Models.ExecutionResult> Execute Executes a data source on the current graph
    • IDataSource dataSource Data source to process
    • int batchSize Initial size of each mini batch
    • System.Action<float> batchCompleteCallback Optional callback to be notifiied after each mini batch has completed
  • Models.ExecutionResult Execute Executes a single vector on the current graph
    • float[] input Vector to execute
  • Models.ExecutionResult ExecuteSequential Executes a sequential input on the current graph
    • int sequenceIndex Index of the current sequence (starting from 0)
    • float[] input Input vector
    • IExecutionContext executionContext Graph execution context
    • MiniBatchSequenceType sequenceType The sequence type (start, standard, end)
  • IReadOnlyList<BrightWire.Models.ExecutionResult> ExecuteSequential Executes a sequence of inputs on the current graph
    • IReadOnlyList<float[]> input List of vector inputs

IGraphOperation

A pending graph operation (mini batch)

Methods

  • void Execute Executes the operation

IGraphTrainingEngine

A graph engine that also trains the graph's parameters against training data

Properties

Methods

  • INode GetInput Returns the specified input node
    • int index Index of the input node to retrieve
  • double Train Executes a training epoch on the graph
    • IExecutionContext executionContext Graph execution context
    • System.Action<float> batchCompleteCallback Optional callback to be notifiied after each mini batch has completed
  • bool Test Executes test data on the current graph
    • IDataSource testDataSource Data source with test data
    • IErrorMetric errorMetric Error metric to use to evaluate the test score
    • int batchSize Initial size of each mini batch
    • System.Action<float> batchCompleteCallback Optional callback to be notifiied after each mini batch has completed
  • void LoadParametersFrom Loads model parameters into the existing graph

IHaveAction

Node that exposes an action

Properties

IHaveColumns

Column provider

Properties

  • IReadOnlyList<BrightWire.IColumn> Columns The list of columns
  • int ColumnCount The number of columns

IHaveMemoryNode

Nodes that have a memory feeder sub-node

Properties

  • INode Memory The memory feed sub node

IIndexable3DTensor

A 3D tensor that can be directly indexed

Properties

  • float this Returns a value from the tensor
  • IReadOnlyList<BrightWire.IIndexableMatrix> Matrix Gets a list of the indexable matrices
  • string AsXml Returns the matrix as xml

Methods

  • float[] GetInternalArray Returns the underlying array used as storage (changes to this array will affect the tensor as well)

IIndexable4DTensor

A 4D tensor that can be directly indexed

Properties

  • float this Returns a value from the tensor
  • IReadOnlyList<BrightWire.IIndexable3DTensor> Tensors Gets a list of the indexable matrices
  • string AsXml Returns the matrix as xml

Methods

  • float[] GetInternalArray Returns the underlying array used as storage (changes to this array will affect the tensor as well)

IIndexableMatrix

A matrix whose elements can be indexed directly

Properties

  • float this Returns an element from the current matrix
  • IEnumerable<BrightWire.IIndexableVector> Rows Returns the rows of the current matrix as vectors
  • IEnumerable<BrightWire.IIndexableVector> Columns Returns the columns of the current matrix as vectors
  • IEnumerable<float> Values Returns each element in the current matrix as enumerable
  • string AsXml Returns the matrix as xml

Methods

  • IIndexableMatrix Map Mutates each element of the current matrix
    • System.Func<System.Single, System.Single> mutator The function to apply to each element
  • IIndexableMatrix MapIndexed Mutates each element of the current matrix
    • System.Func<System.Int32, System.Int32, System.Single, System.Single> mutator The function to apply to each element (rowIndex: int, columnIndex: int, value: float) => float
  • float[] GetInternalArray Returns the underlying array used as storage (changes to this array will affect the matrix as well)

IIndexableVector

Returns an indexable vector (in which elements can be directly indexed)

Properties

  • float this Returns an element at the specified index
  • IEnumerable<float> Values Gets the values as an enumerable

Methods

  • float[] ToArray Converts the vector to an array
  • float[] GetInternalArray Returns the underlying array used as storage (changes to this array will affect the vector as well)
  • IIndexableVector Append Creates a new vector (without in place modification) in which new values are appended onto the end of the current vector
    • IReadOnlyList<float> data The values to append

IIndexColumnInfo

Column statistics for index based columns

Properties

  • uint MinIndex Minimum index
  • uint MaxIndex Maximum index

IIndexListClassifier

A classifier that classifies index lists

Methods

  • IReadOnlyList<(System.String Label, System.Single Weight)> Classify Classifies the input data and returns the classifications with their weights

IIndexListEncoder

Encodes index lists to dense vectors

Methods

  • float[] Encode Encodes the index lists to a dense vector

ILearningContext

Graph learning context

Properties

  • double EpochSeconds The duration in seconds of the last epoch
  • System.Int64 EpochMilliseconds The duration in milliseconds of the last epoch
  • ILinearAlgebraProvider LinearAlgebraProvider The linear algebra provider
  • int CurrentEpoch The index of the current epoch (starting from one)
  • float LearningRate The current learning/training rate
  • float BatchLearningRate The learning rate adjusted with the current batch size
  • int BatchSize The current mini batch size
  • int RowCount The total number of rows per epoch
  • TrainingErrorCalculation TrainingErrorCalculation True if the graph should calculate training error
  • bool DeferUpdates True if updates are deferred until the mini batch is complete

Methods

  • void StoreUpdate Stores an update to the model parameters
    • INode fromNode The node that is affected by this update
    • T update The update
    • System.Action<T> updater Callback to execute the update
  • void ApplyUpdates Apply any deferred updates
  • void StartEpoch Start a new epoch
  • void EndEpoch End the current epoch
  • void SetRowCount Sets the number of rows
    • int rowCount The number of rows per epoch
  • void DeferBackpropagation Register the backpropagation to be deferred
    • IGraphData errorSignal The error signal associated with this backpropagation (optional, can be null)
    • System.Action<BrightWire.IGraphData> update The callback to execute the backpropagation
  • void BackpropagateThroughTime Backpropagates the error signal across all deferred backpropagations
    • IGraphData signal The backpropagation signal
    • int maxDepth The maximum depth to backpropagate the signal
  • void ScheduleLearningRate Schedules a change in the learning rate the specified epoch
    • int atEpoch The epoch to change the learning rate
    • float newLearningRate The learning rate to use at that epoch
  • void EnableNodeUpdates Enable or disable node parameter updates
    • INode node The node to modify
    • bool enableUpdates True if the node can make updates via backpropagation
  • void Clear Resets the learning context

ILinearAlgebraProvider

Provides linear algebra functionality

Properties

  • bool IsStochastic Underlying setting for stochastic vs deterministic behaviour for instances created from this provider
  • bool IsGpu True if the provider uses the GPU

Methods

  • IVector CreateVector Creates a new vector
    • int length Length of the vector
    • bool setToZero True to initialise the data to zero (otherwise it might be anything)
  • IVector CreateVector Creates a vector
    • int length Size of the vector
    • System.Func<System.Int32, System.Single> init Callback to initialise each element of the vector
  • IMatrix CreateMatrix Creates a matrix
    • int rows The number of rows
    • int columns The number of columns
    • bool setToZero True to initialise the data to zero (otherwise it might be anything)
  • IMatrix CreateMatrix Creates a matrix
    • int rows The number of rows
    • int columns The number of columns
    • System.Func<System.Int32, System.Int32, System.Single> init Callback to initialise each element of the matrix
  • IMatrix CreateMatrixFromRows Creates a matrix from a list of vectors. Each vector will become a row in the new matrix
    • IReadOnlyList<BrightWire.IVector> vectorRows List of vectors for each row
  • IMatrix CreateMatrixFromColumns Creates a matrix from a list of vectors. Each vector will become a column in the new matrix
    • IReadOnlyList<BrightWire.IVector> vectorColumns List of vectors for each column
  • I3DTensor Create3DTensor Creates a 3D tensor
    • int rows Number of rows
    • int columns Number of columns
    • int depth Number of depth slices
    • bool setToZero True to initialise the data to zero (otherwise it might be anything)
  • I3DTensor Create3DTensor Creates a 3D tensor from a list of matrices
    • IReadOnlyList<BrightWire.IMatrix> matrices List of matrices
  • I4DTensor Create4DTensor Creates a 4D tensor
    • int rows Number of rows
    • int columns Number of columns
    • int depth Number of matrices
    • int count Number of 3D tensors
    • bool setToZero True to initialise the data to zero (otherwise it might be anything)
  • I4DTensor Create4DTensor Creates a 4D tensor from a list of 3D tensors
    • IReadOnlyList<BrightWire.I3DTensor> tensors List of 3D tensors
  • I4DTensor Create4DTensor Creates a 4D tensor from a list of 3D tensors
    • IReadOnlyList<BrightWire.Models.FloatTensor> tensors List of 3D tensors
  • void PushLayer Creates a save point in the allocation history
  • void PopLayer Releases all allocated memory since the last save point
  • IMatrix CalculateDistances Calculates the distance of each vector against the comparison vectors - the size of all vectors should be the same
    • IReadOnlyList<BrightWire.IVector> vectors
    • IReadOnlyList<BrightWire.IVector> comparison
    • DistanceMetric distanceMetric

ILinearRegressionPredictor

Linear regression predictor

Methods

  • float Predict Predicts a value from input data
    • float[] vals The input data
  • float Predict Predicts a value from input data
    • IReadOnlyList<float> vals The input data
  • float[] Predict Bulk value prediction
    • IReadOnlyList<IReadOnlyList<float>> input List of data to predict

ILinearRegressionTrainer

Trainer for linear regression models

Methods

  • Models.LinearRegression GradientDescent Solves the model using gradient descent
    • int iterations Number of training epochs
    • float learningRate The training rate
    • float lambda Regularisation lambda
    • System.Func<System.Single, System.Boolean> costCallback Callback with current cost - False to stop training
  • float ComputeCost Computes the cost of the specified parameters
    • IVector theta The model parameters
    • float lambda Regularisation lambda

ILogisticRegressionClassifier

Logistic regression classifier

Methods

  • float Predict Outputs a value from 0 to 1
    • float[] vals Input data
  • float Predict Outputs a value from 0 to 1
    • IReadOnlyList<float> vals Input data
  • float[] Predict Outputs a list of values from 0 to 1 for each input data
    • IReadOnlyList<IReadOnlyList<float>> input Input data

ILogisticRegressionTrainer

A logistic regression trainer

Methods

  • Models.LogisticRegression GradientDescent Trains a model using gradient descent
    • int iterations Number of training epochs
    • float learningRate The training rate
    • float lambda Regularisation lambda
    • System.Func<System.Single, System.Boolean> costCallback Callback with current cost - False to stop training
  • float ComputeCost Computes the cost of the specified parameters
    • IVector theta The model parameters
    • float lambda Regularisation lambda

IMarkovModelTrainer<T>

Markov model trainer

Methods

  • void Add Adds a sequence of items to the trainer
    • IEnumerable<T> items

IMarkovModelTrainer2<T>

Markov model trainer (window size 2)

Methods

IMarkovModelTrainer3<T>

Markov model trainer (window size 3)

Methods

IMatrix

A matrix

Properties

  • bool IsValid Checks if the matrix has not been disposed
  • int ColumnCount The number of columns
  • int RowCount The number of rows
  • Models.FloatMatrix Data Converts the current matrix to protobuf format

Methods

  • IMatrix Multiply Multiplies the current vector (without in place modification) with the target matrix
  • IVector Column Returns a column as a vector
    • int index The column index
  • IVector Diagonal Returns the matrix diagonal as a vector
  • IVector Row Returns a row as a vector
    • int index The row index
  • IMatrix Add Returns the current matrix (without in place modification) added to the target matrix
  • IMatrix Subtract Returns the current matrix (without in place modification) minus the target matrix
  • IMatrix PointwiseMultiply Returns the pointwise product of the current matrix (without in place modification) with the target matrix
  • IMatrix TransposeAndMultiply Returns the current matrix (without in place modification) and multipled with the transposed target matrix
  • IMatrix TransposeThisAndMultiply Returns the transpose of the current matrix (without in place modification) multipled with the target matrix
  • IVector RowSums Returns a vector that contains the sum of the elements in each row of the current matrix
  • IVector ColumnSums Returns a vector that contains the sum of the elements in each column of the current matrix
  • IMatrix Transpose Returns the transpose of the current matrix
  • void Multiply Multiplies (in place) each element of the matrix by a scalar
    • float scalar The scalar to multiply each element
  • IMatrix Multiply Returns the product of the current matrix (without in place modification) with the target vector
  • void AddInPlace Adds the target matrix to the current matrix (in place)
    • IMatrix matrix The target matrix
    • float coefficient1 A coefficient to multiply each element of the current matrix
    • float coefficient2 A coefficient to multipy each element of the target matrix
  • void SubtractInPlace Subtracts the target matrix from the current matrix (in place)
    • IMatrix matrix The target matrix
    • float coefficient1 A coefficient to multiply each element of the current matrix
    • float coefficient2 A coefficient to multipy each element of the target matrix
  • IMatrix SigmoidActivation Returns a new matrix with the sigmoid function applied to each element
  • IMatrix SigmoidDerivative Returns a new matrix with the sigmoid derivative of each element
  • IMatrix TanhActivation Returns a new matrix with the tanh function applied to each element
  • IMatrix TanhDerivative Returns a new matrix with the tanh derivative of each element
  • IMatrix SoftmaxActivation Returns a new matrix with the softmax function applied to each row of the matrix
  • void AddToEachRow Adds the target vector to each row of the current matrix (in place)
  • void AddToEachColumn Adds the target vector to each column of the current matrix (in place)
  • IIndexableMatrix AsIndexable Converts the matrix to an indexable matrix
  • IMatrix GetNewMatrixFromRows Returns a new matrix from a subset of the current matrix's rows
    • IReadOnlyList<int> rowIndexes The list of row indices
  • IMatrix GetNewMatrixFromColumns Returns a new matrix from a subset of the current matrix's columns
    • IReadOnlyList<int> columnIndexes The list of column indices
  • void ClearRows Set to zero the specified rows in the current matrix
    • IReadOnlyList<int> indexes The list of row indices
  • void ClearColumns Set to zero the specified columns in the current matrix
    • IReadOnlyList<int> indexes The list of column indices
  • IMatrix ReluActivation Returns the RELU function applied to each element of the current matrix
  • IMatrix ReluDerivative Returns the RELU derivative of each element in the current matrix
  • IMatrix LeakyReluActivation Returns the leaky RELU function applied to each element in the current matrix
  • IMatrix LeakyReluDerivative Returns the leaky RELU derivative of each element in the current matrix
  • IMatrix Clone Creates a copy of the current matrix
  • void Clear Sets each element to zero
  • IMatrix Sqrt Returns the square root of each element in the current matrix
    • float valueAdjustment Term to add to each element in the result matrix
  • IMatrix Pow Returns each element raised to specified power
    • float power The power to apply to each element
  • IMatrix PointwiseDivide Returns the current matrix (not modified in place) divided by the target matrix
  • void L1Regularisation L1 Regularisation applied to each element of the current matrix (in place)
    • float coefficient The L1 coefficient
  • IVector ColumnL2Norm Returns a vector of the L2 norms of each column
  • IVector RowL2Norm Returns a vector of the L2 norms of each row
  • void PointwiseDivideRows Pointwise divide each row by the target vector (in place)
  • void PointwiseDivideColumns Pointwise divide each column by the target vector (in place)
  • void Constrain Constrain each value within the specified min and max values (in place)
    • float min The minimum allowed value
    • float max The maximum allowed value
  • IVector GetRowSegment Returns a segment from a row of the current matrix
    • int rowIndex The row index
    • int columnIndex The start index to return
    • int length The number of elements to return
  • IVector GetColumnSegment Returns a segment from a column of the current matrix
    • int columnIndex The column index
    • int rowIndex The start index to return
    • int length The number of elements to return
  • IMatrix ConcatColumns Returns a new matrix with the columns of the target matrix appended to each column of the current matrix
  • IMatrix ConcatRows Returns a new matrix with the rows of the target matrix appended to each row of the current matrix
  • (BrightWire.IMatrix Left, BrightWire.IMatrix Right) SplitAtColumn Splits the rows of the current matrix into two matrices
    • int columnIndex The column index at which to split
  • (BrightWire.IMatrix Top, BrightWire.IMatrix Bottom) SplitAtRow Splits the columns of the current matrix into two matrices
    • int rowIndex The row index at which to split
  • (BrightWire.IMatrix U, BrightWire.IVector S, BrightWire.IMatrix VT) Svd Singular value decomposition
  • IVector ReshapeAsVector Fast conversion to vector (the internal buffer is not modified)
  • I3DTensor ReshapeAs3DTensor Reshapes the matrix to a 3D tensor, treating each column as a depth slice in the new 3D tensor
    • int rows Row count of each sub matrix
    • int columns Column count of each sub matrix
  • I4DTensor ReshapeAs4DTensor Converts the matrix to a 4D tensor, treating each column as a 3D tensor
    • int rows Row count of each sub matrix
    • int columns Column count of each sub matrix
    • int depth Depth of each 3D tensor
  • float GetAt Returns the value at the specified row and column index
    • int row Row index
    • int column Column index
  • void SetAt Updates the value at the specified row and column index
    • int row Row index
    • int column Column index
    • float value Value to set

IMemoryNode

Recurrent neural networks memory node

Properties

IMiniBatch

Information about the current mini batch

Properties

  • IReadOnlyList<int> Rows Row indexes of the current batch
  • IDataSource DataSource Data source
  • bool IsSequential True if the data is sequential
  • int BatchSize Number of items in the batch
  • IMiniBatchSequence CurrentSequence Current sequence (non sequential batches have a single sequence)
  • bool HasNextSequence True if there is another item in the sequence after the current item
  • int SequenceCount Gets the length of the sequence

Methods

  • IMiniBatchSequence GetNextSequence Gets the next item in the sequence
  • IMiniBatchSequence GetSequenceAtIndex Gets a sequence item
    • int index The index to retrieve
  • void Reset Resets the sequence iterator

IMiniBatchSequence

A sequence within a mini batch

Properties

INode

Graph node

Properties

  • string Id Unique id
  • string Name Friendly name
  • List<BrightWire.IWire> Output List of outgoing wires
  • IEnumerable<BrightWire.INode> SubNodes Sub-nodes of the current node

Methods

  • void ExecuteForward Executes the node forward
    • IContext context Graph context
    • int channel Channel the signal was received on
  • INode FindByName Searches for a node by friendly name
    • string name Friendly name of the node to find
  • INode FindById Searches for a node by id
    • string id Unique id of the node
  • Models.ExecutionGraph.Node SerialiseTo Serialise the node
    • HashSet<BrightWire.INode> existing Set of nodes that have already been serialised in the current context
    • List<BrightWire.Models.ExecutionGraph.Node> connectedTo List of nodes this node is connected to
    • HashSet<BrightWire.Models.ExecutionGraph.Wire> wireList List of wires between all connected nodes
  • void OnDeserialise Called after the graph has been completely deserialised
    • IReadOnlyDictionary<System.String, BrightWire.INode> graph Dictionary of nodes with their associated unique ids
  • void LoadParameters Loads parameters into an existing node

INumericColumnInfo

Column statistics for a numeric column

Properties

  • double Min The minimum value
  • double Max The maximum value
  • double Mean The mean (or average)
  • double? StdDev The standard deviation
  • double? Median The median value
  • double? Mode The mode
  • double L1Norm The L1 Norm
  • double L2Norm The L2 Norm

IPropertySet

The current set of graph initialisation parameters

Properties

Methods

IRandomProjection

Random projection

Properties

  • int Size The size to reduce to
  • IMatrix Matrix The transformation matrix

Methods

IRow

A data table row

Properties

  • int Index The index of this row within the data table
  • IReadOnlyList<object> Data Gets the raw data from the row
  • IHaveColumns Table Returns the column information

Methods

  • T GetField Gets the value of the specified column (converted to T)
    • int index The column index to query
  • IReadOnlyList<T> GetFields Gets the specified strongly typed values
    • IReadOnlyList<int> indices The column indices to return

IRowClassifier

A classifier that classifies a data table row

Methods

  • IReadOnlyList<(System.String Label, System.Single Weight)> Classify Classifies the input data and returns the classifications with their weights
    • IRow row The row to classify

IRowEncoder

Encodes data table rows to dense vectors

Methods

  • float[] Encode Encodes a data table row to a dense vector
    • IRow row The row to encode

IRowProcessor

Row processor

Methods

  • bool Process Will be called for each row
    • IRow row The current row

IStringColumnInfo

Column statistics for a string based column

Properties

  • int MinLength The minimum string length
  • int MaxLength The maximum string length
  • string MostCommonString The most common string

ISummariseRows

Summarises multiple rows into one row

Methods

  • IRow Summarise Summarises multiple rows into one row
    • IReadOnlyList<BrightWire.IRow> rows List of rows

IVector

A vector

Properties

  • bool IsValid Checks if the vector has not been disposed
  • int Count The number of elements in the vector
  • Models.FloatVector Data Converts the vector into protobuf format

Methods

  • IMatrix ReshapeAsColumnMatrix Converts the vector to a column matrix
  • IMatrix ReshapeAsRowMatrix Converts the vector to a row matrix
  • IVector Add Adds a vector (without in place modification)
  • IVector Subtract Subtracts a vector (without in place modification)
    • IVector vector The vector to subtract
  • float L1Norm Calculates the absolute values (L1) norm: https://en.wikipedia.org/wiki/Norm_(mathematics)
  • float L2Norm Calculates the euclidean (L2) norm: https://en.wikipedia.org/wiki/Norm_(mathematics)
  • int MaximumIndex Returns the index of the vector with the greatest value
  • int MinimumIndex Returns the index of the vector with the smallest value
  • void Multiply Multiples (in place) by a scalar
    • float scalar The value to multiple each element
  • void Add Adds (in place) a scalar
    • float scalar The value to add to each element
  • void AddInPlace Adds a vector in place
    • IVector vector The target vector to add to the current vector
    • float coefficient1 A value to multiply each element of the current vector
    • float coefficient2 A value to multiply each element of the target vector
  • void SubtractInPlace Subtracts a vector in place
    • IVector vector The target vector to subtract from the current vector
    • float coefficient1 A value to multiply each element of the current vector
    • float coefficient2 A value to multiply each element of the target vector
  • IIndexableVector AsIndexable Converts the vector to an indexable vector
  • IVector PointwiseMultiply Pointwise multiplication (without in place modification) with a vector
  • float DotProduct The dot product of two vectors
  • IVector GetNewVectorFromIndexes Returns a new vector from a subset of the vector indices
    • IReadOnlyList<int> indices A list of indexes to use as the source of the new vector
  • IVector Clone Creates a new copy of the vector
  • IVector Sqrt Creates a new vector in which each element is the square root of the current vector
  • IVector Abs Creates a new vector in which each element is the absolute value of the current vector
  • void CopyFrom Copies values from the target vector into the current vector
  • float EuclideanDistance Calculates the euclidean distance between the current and the target vector
  • float CosineDistance Calculates the cosine distance between the current and the target vector
  • float ManhattanDistance Calculates the manhattan distance between the current and the target vector
  • float MeanSquaredDistance Calculates the mean squared distance between the current and the target vector
  • float SquaredEuclidean Calculates the squared euclidean distance between the current and the target vector
  • (System.Single Min, System.Single Max) GetMinMax Finds the minimum and maximum values in the current vector
  • float Average Calculates the average value from the elements of the current vector
  • float StdDev Calculates the standard deviation from the elements of the current vector
    • float? mean (optional) pre calculated mean
  • void Normalise Normalises (in place) the values of the current vector
  • IVector Softmax Returns the softmax function (without in place modification) applied to the current vector https://en.wikipedia.org/wiki/Softmax_function
  • IMatrix SoftmaxDerivative Returns the jacobian matrix of the softmax derivative
  • IVector FindDistances Returns a vector of distances between the current and target vectors
    • IReadOnlyList<BrightWire.IVector> data The list of target vectors
    • DistanceMetric distance The distance metric
  • float FindDistance Returns the distance between the current and the target vector
  • IVector CosineDistance Returns a vector of the cosine distance between the current and target vectors
    • IReadOnlyList<BrightWire.IVector> data The list of target vectors
    • float[] dataNorm A buffer to hold the norms of the target vectors
  • IVector Log Returns a vector (without in place modification) in which each element is the natural log of each element in the current vector
  • IVector Sigmoid Returns the sigmoid function (without in place modification) applied to the current vector
  • IMatrix ReshapeAsMatrix Fast conversion to matrix (internal buffer is used directly)
    • int rows The number of rows in the matrix
    • int columns The number of columns in the matrix
  • I3DTensor ReshapeAs3DTensor Converts the vector to a 3D tensor
    • int rows Number of rows in each matrix
    • int columns Number of columns in matrix
    • int depth Number of matrices
  • I4DTensor ReshapeAs4DTensor Converts the vector to a 4D tensor
    • int rows Number of rows in each matrix
    • int columns Number of columns in matrix
    • int depth Number of matrices
    • int count Number of 3D tensors
  • IReadOnlyList<BrightWire.IVector> Split Splits the vector into a list of vectors
    • int blockCount The number of sub vectors to split into
  • void RotateInPlace Rotates values in the vector (both horizontally and vertically within blocks)
    • int blockCount
  • IVector Reverse Returns a reversed copy of the vector's values
  • float GetAt Returns the value at the specified index
    • int index The index of the vector to return
  • void SetAt Updates the value at the specified index
    • int index
    • float value
  • bool IsEntirelyFinite Checks if every value in the vector is finite (not NaN or positive/negative infinity)

IVolumeDataSource

Volume (3D tensor) based data sources

Properties

  • int Width Width of each input volume
  • int Height Height of each input volume
  • int Depth Depth of each input volume

IWeightedIndexListEncoder

Encodes weighted index lists to dense vectors

Methods

IWeightInitialisation

Neural network weight initialiser

Methods

  • IVector CreateBias Creates the bias vector
    • int size The size of the vector
  • IMatrix CreateWeight Creates the weight matrix
    • int rows Row count
    • int columns Column count

IWire

Wires connect nodes in the graph

Properties

  • INode SendTo The node to send a signal to
  • int Channel The channel

ColumnType

Data table column type

  • Null - Nothing (0)
  • Boolean - Boolean values (1)
  • Byte - Byte values (-128 to 128) (2)
  • Int - Integer values (3)
  • Long - Long values (4)
  • Float - Float values (5)
  • Double - Double values (6)
  • String - String values (7)
  • Date - Date values (8)
  • IndexList - List of indices (9)
  • WeightedIndexList - Weighted list of indices (10)
  • Vector - Vector of floats (11)
  • Matrix - Matrix of floats (12)
  • Tensor - 3D tensor of floats (13)

Models.Bayesian.NaiveBayes.ColumnType

The type of data within the column

  • ContinuousGaussian - Continuous values (0)
  • Categorical - Categorical values (1)

DistanceMetric

Distance metrics

  • Euclidean - Euclidean Distance (0)
  • Cosine - Cosine Distance Metric (1)
  • Manhattan - Manhattan Distance (2)
  • MeanSquared - Means Square Error (3)
  • SquaredEuclidean - Square Euclidean (4)

GaussianVarianceCalibration

Gaussian weight initialisation type

  • SquareRootN - Variances are calibrated by dividing by the square root of the connection count (0)
  • SquareRoot2N - Variances are calibrated by multiplying by twice the square root of the connection count (1)

GaussianVarianceCount

Gaussian variance count

  • None - No variance calibration is applied (0)
  • FanIn - The count of incoming connections is used (1)
  • FanOut - The count of outgoing connections is used (2)
  • FanInFanOut - The count incoming and outgoing connections is used (3)

MiniBatchSequenceType

Mini batch type

  • Standard - Standard batch type (non sequential batches have a single standard sequence item) (0)
  • SequenceStart - Start of a sequence (1)
  • SequenceEnd - End of a sequence (2)

NormalisationType

Data normalisation options

  • Standard - Normalises based on standard deviation (0)
  • Manhattan - Normalise from manhattan distance (1)
  • Euclidean - Normalise from eucildean distance (2)
  • FeatureScale - Normalise based on min and max values (3)

TrainingErrorCalculation

Describes how to calculate the training error

  • None - Do not calculate the training error (0)
  • Fast - Compare the output against the target output (1)
Fork me on GitHub