NeuralNetworkHelper<T>

Helpers & Utilities · AiDotNet.Helpers

Provides helper methods for neural network operations including activation functions and loss functions.

For Beginners

Neural networks are computing systems inspired by the human brain. They process information through interconnected nodes (neurons) that transform input data using mathematical functions. This helper class provides those mathematical functions needed to build neural networks.

Methods

Method Summary
IActivationFunction<T> GetDefaultActivationFunction(NeuralNetworkTaskType taskType) Gets the default activation function based on the task type.
ILossFunction<T> GetDefaultLossFunction(NeuralNetworkTaskType taskType) Gets the default loss function based on the task type.
IVectorActivationFunction<T> GetDefaultVectorActivationFunction(NeuralNetworkTaskType taskType) Gets the default vector activation function based on the task type.
T EuclideanDistance(Vector<T> v1, Vector<T> v2) Calculates the Euclidean distance between two vectors.
Tensor<T> ApplyActivation(Tensor<T> input, IActivationFunction<T> scalarActivation, IVectorActivationFunction<T> vectorActivation) Applies an activation function to a tensor of values.
Vector<T> ApplyActivation(Vector<T> input, IActivationFunction<T> scalarActivation, IVectorActivationFunction<T> vectorActivation) Applies an activation function to a tensor of values.
void ApplyOutputActivation(Tensor<T> output, NeuralNetworkArchitecture<T> architecture) Applies the appropriate activation function to the output tensor based on the task type.