143 references to Log
Microsoft.CodeAnalysis.CSharp (1)
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.ValueDispatchNode.cs (1)
117Debug.Assert(_height < 2 * Math.Log(_weight));
Microsoft.CodeAnalysis.Workspaces (4)
Shared\Utilities\BloomFilter.cs (4)
82var numerator = n * Math.Log(p); 83var denominator = Math.Log(1.0 / Math.Pow(2.0, Math.Log(2.0))); 93var temp = Math.Log(2.0) * m / n;
Microsoft.ML.AutoML (4)
Sweepers\SweeperProbabilityUtils.cs (1)
41rvs.Add(mu + sigma * Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.PI * u2));
Tuner\SmacTuner.cs (1)
291var newFeatured = mu + sigma * Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.PI * u2);
Utils\ArrayMath.cs (1)
88return xArray.Select(x => Math.Log(x)).ToArray();
Utils\RandomNumberGenerator.cs (1)
37double std = Math.Sqrt(-2.0 * Math.Log(u)) * Math.Sin(2.0 * Math.PI * v);
Microsoft.ML.AutoML.Tests (1)
TunerTests.cs (1)
433return Math.Log(Math.Exp(x) + Math.Exp(y) + Math.Exp(z));
Microsoft.ML.Core (24)
Utilities\MathUtils.cs (12)
37return Math.Log(x).ToFloat(); 234return (float)(max + Math.Log(1.0 + intermediate)); 261return (float)(max + Math.Log(1.0 + Math.Exp(negDiff))); 296private static readonly double _constantForLogGamma = 0.5 * Math.Log(2 * Math.PI); 316res = -Math.Log(v2); 321res += _constantForLogGamma + (x + 0.5) * Math.Log(x) - x; 364_logFactorialCache.Add(_logFactorialCache[i - 1] + Math.Log(i)); 772? -prob * Math.Log(prob) - (1 - prob) * Math.Log(1 - prob) 787? -probTrue * Math.Log(probPredicted) - (1 - probTrue) * Math.Log(1 - probPredicted) 817return (float)Math.Log(soFar) + max;
Utilities\Stats.cs (8)
65} while (q > 0.27597 && (q > 0.27846 || v * v > -4 * u * u * Math.Log(u))); 99Math.Log(u) < 0.5 * xSqr + d * (1.0 - v + Math.Log(v))) 193logLam = Math.Log(lambda); 400v = Math.Log(v); 415h = (m + 0.5) * Math.Log((m + 1) / (r * nm)) + Fc(m) + Fc(n - m); 417double vval = h + (n + 1) * Math.Log((double)nm / (double)nk) + (k + 0.5) * Math.Log(nk * r / (double)(k + 1)) - Fc(k) - Fc(n - k);
Utilities\SummaryStatistics.cs (2)
244double delta = 1.0 / Math.Sqrt(Math.Log(Math.Sqrt(w2))); 247double z1 = delta * Math.Log(yDivAlpha + Math.Sqrt(yDivAlpha * yDivAlpha + 1.0));
Utilities\SupervisedBinFinder.cs (2)
252Double logN = Math.Log(lim - min); 295entropy -= p * Math.Log(p);
Microsoft.ML.CpuMath (1)
ProbabilityFunctions.cs (1)
140r = Math.Sqrt(-Math.Log(r));
Microsoft.ML.Data (21)
Evaluators\ClusteringEvaluator.cs (2)
266nmi += pxy * Math.Log(pxy / (px * py)); 269entropy += -px * Math.Log(px);
Evaluators\MulticlassClassificationEvaluator.cs (5)
304entropy += _sumWeightsOfClass[i] * Math.Log(_sumWeightsOfClass[i] / _numInstances); 475logloss = -Math.Log(p); 480logloss = -Math.Log(Epsilon); 797dst = -Math.Log(p); 801dst = -Math.Log(Epsilon);
Evaluators\RankingEvaluator.cs (1)
972discountMap[i] = 1 / Math.Log(2 + i);
Prediction\Calibrator.cs (3)
1507offset = Math.Log((prior0 + 1) / (prior1 + 1)); 1590logp = Math.Log(p); 1592log1p = Math.Log(1 - p);
Transforms\NormalizeColumnDbl.cs (4)
511var val = _useLog ? (TFloat)Math.Log(origVal) : origVal; 1006var val = UseLog ? (TFloat)Math.Log(input) : input; 1117var val = useLog ? (TFloat)Math.Log(values[i]) : values[i]; 1133var val = useLog ? (TFloat)Math.Log(values[ii]) : values[ii];
Transforms\NormalizeColumnSng.cs (4)
513var val = _useLog ? (TFloat)Math.Log(origVal) : origVal; 1166var val = UseLog ? (TFloat)Math.Log(input) : input; 1278var val = useLog ? (TFloat)Math.Log(values[i]) : values[i]; 1294var val = useLog ? (TFloat)Math.Log(values[ii]) : values[ii];
Utils\LossFunctions.cs (2)
179return Math.Log(Math.Max(x, 1e-8)); 633return output - label * Math.Log(output) + MathUtils.LogGamma(label);
Microsoft.ML.FastTree (33)
Dataset\FeatureFlock.cs (16)
213featureFirstUsePenalty : featureReusePenalty * Math.Log(featureUseCount[feature] + 1); 301double entropyGain = (totalCount * Math.Log(totalCount) - lteCount * Math.Log(lteCount) - gtCount * Math.Log(gtCount)); 366: featureReusePenalty * Math.Log(featureUseCount[firstFlockFeature] + 1); 444double entropyGain = (totalCount * Math.Log(totalCount) - lteCount * Math.Log(lteCount) - 445gtCount * Math.Log(gtCount)); 586: featureReusePenalty * Math.Log(featureUseCount[firstFlockFeature] + 1); 649double entropyGain = (totalCount * Math.Log(totalCount) - lteCount * Math.Log(lteCount) - 650gtCount * Math.Log(gtCount)); 808: featureReusePenalty * Math.Log(featureUseCount[firstFlockFeature] + 1); 871double entropyGain = (totalCount * Math.Log(totalCount) - lteCount * Math.Log(lteCount) - 872gtCount * Math.Log(gtCount));
FastTreeRanking.cs (2)
915double normFactor = (10 * Math.Log(1 + lambdaSum)) / lambdaSum; 955_discount[d] = 1.0 / Math.Log(2.0 + d);
FastTreeTweedie.cs (2)
436var step = shrinkage * (Math.Log(num) - Math.Log(denom));
SumupPerformanceCommand.cs (4)
115double denom = Math.Log(1 - _param); 138int numZeros = (int)Math.Min(Math.Floor(Math.Log(r) / denom), remaining); 188double denom = Math.Log(1 - p); 207yield return Math.Floor(Math.Log(r) / denom);
Training\DcgCalculator.cs (2)
39DiscountMap[i] = 1.0 / Math.Log(2 + i); 145maxDcg += LabelMap[topLabel] / Math.Log(2.0 + t);
Training\EnsembleCompression\LassoBasedEnsembleCompressor.cs (2)
453fit.Lambdas[0] = Math.Exp(2 * Math.Log(fit.Lambdas[1]) - Math.Log(fit.Lambdas[2]));
Training\Test.cs (1)
680double loss = Math.Log(1.0 + Math.Exp(-1.0 * _sigmoidParameter * (label ? 1 : -1) * scores[i]));
Training\TreeLearners\LeastSquaresRegressionTreeLearner.cs (4)
776double entropyGain = (totalCount * Math.Log(totalCount) - lteCount * Math.Log(lteCount) - gtCount * Math.Log(gtCount)); 801FeatureFirstUsePenalty : FeatureReusePenalty * Math.Log(FeatureUseCount[feature] + 1);
Microsoft.ML.GenAI.Phi (2)
Module\Phi3SuScaledRotaryEmbedding.cs (2)
72scalingFactor = Math.Sqrt(1 + Math.Log(scale) / Math.Log(this._originalMaxPositionEmbeddings));
Microsoft.ML.IntegrationTests (1)
SchemaDefinitionTests.cs (1)
85dst.Features[2 * i + 1] = (float)Math.Log(src.Features[i]);
Microsoft.ML.KMeansClustering (1)
KMeansPlusPlusTrainer.cs (1)
1635double key = Math.Log(rand.NextDouble()) / weight;
Microsoft.ML.SearchSpace (3)
Option\UniformNumericOption.cs (3)
63var logMax = Math.Log(Max); 64var logMin = Math.Log(Min); 65var logX = Math.Log(x);
Microsoft.ML.StandardTrainers (12)
Optimizer\DifferentiableFunction.cs (1)
360return (float)(Math.Sqrt(-2 * Math.Log(a)) * MathUtils.Cos(2 * Math.PI * b));
Optimizer\LineSearch.cs (2)
459return (float)(Math.Log(1 + 1.0 / e) + Math.Log(1 + e) - 0.5 * x);
Standard\LogisticRegression\MulticlassLogisticRegression.cs (1)
351nullDeviance -= (float)(2 * _prior[iLabel] * Math.Log(_prior[iLabel] / WeightSum));
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (7)
399Math.Log(1 + ((double)labelOccuranceCount - featureHistogram[iLabel][iFeature])) - 400Math.Log(labelOccuranceCount + labelCount); 592logProb += Math.Log(featureCount + 1) - Math.Log(labelOccurrenceCount + _labelCount); 593absentFeatureLogProb += Math.Log(absentFeatureCount + 1) - Math.Log(labelOccurrenceCount + _labelCount); 608double logProb = Math.Log(labelOccurrenceCount / _totalTrainingCount);
Standard\SdcaBinary.cs (1)
2064Double loss = Math.Log(2); // for log loss, this is exact; for Hinge, it's a reasonable estimate
Microsoft.ML.Sweeper (1)
Algorithms\SweeperProbabilityUtils.cs (1)
71rvs.Add(mu + sigma * Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.PI * u2));
Microsoft.ML.TimeSeries (9)
RootCauseAnalyzer.cs (2)
720private double Log2(double val) => Double.IsNaN(val) ? 0 : Math.Log(val) / Math.Log(2);
SequentialAnomalyDetectionTransformBase.cs (5)
279return Math.Log(epsilon) + (epsilon - 1) * Math.Log(p); 294Double logP = Math.Log(p); 295return Math.Log(p * logP + 1 - p) - 2 * Math.Log(-logP) - logP;
SrCnnEntireAnomalyDetector.cs (1)
569_magLogList[i] = Math.Log(_magList[i]);
TrajectoryMatrix.cs (1)
128_shouldFftUsed = _windowSize * _k > (3 + 3 * Math.Log(_seriesLength)) * _seriesLength;
Microsoft.ML.TorchSharp (1)
NasBert\Modules\Embedding\SinusoidalPositionalEmbedding.cs (1)
38var embedDouble = Math.Log(10000) / (halfDim - 1);
Microsoft.ML.Transforms (5)
Dracula\Featurizer.cs (1)
204logOdds[i] = (float)Math.Log(
Expression\BuiltinFunctions.cs (3)
180FunctionProviderUtils.Fn<R8, R8>(Math.Log)); 184FunctionProviderUtils.Fn<R8, R8>(Math.Log), 521return (R4)Math.Log(a);
Text\NgramTransform.cs (1)
306invDocFreqs[iinfo][i] = Math.Log(totalDocs / invDocFreqs[iinfo][i]);
Microsoft.VisualBasic.Core (3)
Microsoft\VisualBasic\Financial.vb (3)
471Return (Log(dTempFv) - Log(dTempPv)) / Log(dTemp4)
ReachFramework (1)
AlphaFlattener\BrushProxy.cs (1)
1944int stopCount = (int)Math.Ceiling(-6.297427 + 4.591693 * Math.Log(stopDistance));
System.Numerics.Tensors (1)
System\Numerics\Tensors\netcore\Tensor.Factory.cs (1)
128values[i] = T.CreateChecked(Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.PI * u2));
System.Private.CoreLib (4)
src\libraries\System.Private.CoreLib\src\System\Double.cs (2)
890public static double Log(double x) => Math.Log(x); 896public static double LogP1(double x) => Math.Log(x + 1);
src\libraries\System.Private.CoreLib\src\System\Math.cs (2)
911return Log(a) / Log(newBase);
System.Runtime.Numerics (7)
System\Numerics\Complex.cs (7)
48private static readonly double s_log2 = Math.Log(2.0); 312return x * Math.Log(xp1) / (xp1 - 1.0); 316return Math.Log(xp1); 550v = s_log2 + Math.Log(big) + 0.5 * Log1P(ratio * ratio); 601v = Math.Log(a + Math.Sqrt((a - 1.0) * (a + 1.0))); 614return new Complex(Math.Log(Abs(value)), Math.Atan2(value.m_imaginary, value.m_real)); 755double newRho = powerReal * theta + powerImaginary * Math.Log(rho);
System.Windows.Forms.Design (3)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (3)
23private static readonly double s_log10 = Math.Log(10); 214int charactersInNumber = ((int)(Math.Log(c - 1) / s_log10) + 1); 566int charactersInNumber = ((int)(Math.Log(maxC) / s_log10) + 1); // Luckily, this is never called if count = 0