1 write to SdcaTrainerOptions
Microsoft.ML.StandardTrainers (1)
Standard\SdcaBinary.cs (1)
310SdcaTrainerOptions = options;
59 references to SdcaTrainerOptions
Microsoft.ML.StandardTrainers (59)
Standard\SdcaBinary.cs (41)
286private protected override bool ShuffleData => SdcaTrainerOptions.Shuffle; 311SdcaTrainerOptions.L2Regularization = l2Const ?? options.L2Regularization; 312SdcaTrainerOptions.L1Regularization = l1Threshold ?? options.L1Regularization; 313SdcaTrainerOptions.MaximumNumberOfIterations = maxIterations ?? options.MaximumNumberOfIterations; 314SdcaTrainerOptions.Check(env); 336if (SdcaTrainerOptions.NumberOfThreads.HasValue) 338numThreads = SdcaTrainerOptions.NumberOfThreads.Value; 351if (SdcaTrainerOptions.ConvergenceCheckFrequency.HasValue) 352checkFrequency = SdcaTrainerOptions.ConvergenceCheckFrequency.Value; 453if (SdcaTrainerOptions.MaximumNumberOfIterations == null) 454SdcaTrainerOptions.MaximumNumberOfIterations = TuneDefaultMaxIterations(ch, count, numThreads); 456Contracts.Assert(SdcaTrainerOptions.MaximumNumberOfIterations.HasValue); 457if (SdcaTrainerOptions.L2Regularization == null) 458SdcaTrainerOptions.L2Regularization = TuneDefaultL2(ch, SdcaTrainerOptions.MaximumNumberOfIterations.Value, count, numThreads); 460Contracts.Assert(SdcaTrainerOptions.L2Regularization.HasValue); 461if (SdcaTrainerOptions.L1Regularization == null) 462SdcaTrainerOptions.L1Regularization = TuneDefaultL1(ch, numFeatures); 464ch.Assert(SdcaTrainerOptions.L1Regularization.HasValue); 465var l1Threshold = SdcaTrainerOptions.L1Regularization.Value; 494ch.Assert(SdcaTrainerOptions.L2Regularization.HasValue); 495var l2Const = SdcaTrainerOptions.L2Regularization.Value; 558ch.Assert(SdcaTrainerOptions.MaximumNumberOfIterations.HasValue); 559var maxIterations = SdcaTrainerOptions.MaximumNumberOfIterations.Value; 584if (SdcaTrainerOptions.BiasLearningRate == 0) 795Contracts.Assert(SdcaTrainerOptions.L1Regularization.HasValue); 800var l1Threshold = SdcaTrainerOptions.L1Regularization.Value; 802var lr = SdcaTrainerOptions.BiasLearningRate * SdcaTrainerOptions.L2Regularization.Value; 805using (var cursor = SdcaTrainerOptions.Shuffle ? cursorFactory.Create(rand) : cursorFactory.Create()) 825if (SdcaTrainerOptions.BiasLearningRate == 0) 871if (SdcaTrainerOptions.BiasLearningRate == 0) 992Contracts.Assert(SdcaTrainerOptions.L2Regularization.HasValue); 993Contracts.Assert(SdcaTrainerOptions.L1Regularization.HasValue); 994Double l2Const = SdcaTrainerOptions.L2Regularization.Value; 995Double l1Threshold = SdcaTrainerOptions.L1Regularization.Value; 1007metrics[(int)MetricKind.L1Sparsity] = SdcaTrainerOptions.L1Regularization == 0 ? 1 : (Double)firstWeights.GetValues().Count(w => w != 0) / weights.Length; 1009bool converged = dualityGap / newLoss < SdcaTrainerOptions.ConvergenceTolerance; 1451private protected override bool ShuffleData => SdcaTrainerOptions.Shuffle; 1509_positiveInstanceWeight = SdcaTrainerOptions.PositiveInstanceWeight; 1519_positiveInstanceWeight = SdcaTrainerOptions.PositiveInstanceWeight;
Standard\SdcaMulticlass.cs (16)
139_loss = loss ?? SdcaTrainerOptions.InternalLoss ?? SdcaTrainerOptions.LossFunctionFactory.CreateComponent(env); 179Contracts.Assert(SdcaTrainerOptions.L1Regularization.HasValue); 188var l1Threshold = SdcaTrainerOptions.L1Regularization.Value; 190var lr = SdcaTrainerOptions.BiasLearningRate * SdcaTrainerOptions.L2Regularization.Value; 194using (var cursor = SdcaTrainerOptions.Shuffle ? cursorFactory.Create(rand) : cursorFactory.Create()) 219if (SdcaTrainerOptions.BiasLearningRate == 0) 289if (SdcaTrainerOptions.BiasLearningRate == 0) 411Contracts.Assert(SdcaTrainerOptions.L2Regularization.HasValue); 412Contracts.Assert(SdcaTrainerOptions.L1Regularization.HasValue); 413Double l2Const = SdcaTrainerOptions.L2Regularization.Value; 414Double l1Threshold = SdcaTrainerOptions.L1Regularization.Value; 426Double l1Regularizer = SdcaTrainerOptions.L1Regularization.Value * l2Const * weightsL1Norm; 438metrics[(int)MetricKind.L1Sparsity] = SdcaTrainerOptions.L1Regularization == 0 ? 1 : weights.Sum( 441bool converged = dualityGap / newLoss < SdcaTrainerOptions.ConvergenceTolerance;
Standard\SdcaRegression.cs (2)
124_loss = loss ?? SdcaTrainerOptions.LossFunction ?? SdcaTrainerOptions.LossFunctionFactory.CreateComponent(env);