SVM implementations - src.
// Create simple SupportVectorMachine
var inputShape = new Shape(28); // shape of input features
var numClasses = 10; // number of hyperplaces - typically one per category
var lambda = 1e-5f; // update factor for HyperPlane weights
var svmInfo = new SVMInfo(inputShape, numClasses, lambda);
var svm = new SupportVectorMachine(svmInfo);
Gradient calculators for HyperPlane
weight updates.
- Adam
- SGD
// Default Values
public Gradient Gradient { get; set; } = Gradient.Adam;
public float LearningRate { get; set; } = .01f;
public float BetaOne { get; set; } = .9f;
public float BetaTwo { get; set; } = .999f;
public float Epsilon { get; set; } = 1e-8f;
// Configure a SupportVectorMachine's Gradient optimizer
var info = new SVMInfo(inputShape, numCategories, 1e-3f);
var svm = new SupportVectorMachine(info, ExecutionStrategy.Sync, new GradientInfo
{
Gradient = Gradient.SGD,
LearningRate = 1e-3f
});
All pre-built examples using Radiate.Data datasets.