Skip to content

XML documentation for Online Gradient Descent trainer. #3422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,30 @@ namespace Microsoft.ML.Trainers
/// Online Gradient Descent (OGD) for estimating the parameters of the linear regression model.
/// </summary>
/// <remarks>
/// <format type="text/markdown"><![CDATA[
/// To create this trainer, use [OnlineGradientDescent](xref:Microsoft.ML.StandardTrainersCatalog.OnlineGradientDescent(Microsoft.ML.RegressionCatalog.RegressionTrainers,System.String,System.String,Microsoft.ML.Trainers.IRegressionLoss,System.Single,System.Boolean,System.Single,System.Int32))
/// or [OnlineGradientDescent(Options)](xref:Microsoft.ML.StandardTrainersCatalog.OnlineGradientDescent(Microsoft.ML.RegressionCatalog.RegressionTrainers,Microsoft.ML.Trainers.OnlineGradientDescentTrainer.Options)).
///
/// [!include[io](~/../docs/samples/docs/api-reference/io-columns-regression.md)]
///
/// ### Trainer Characteristics
/// | | |
/// | -- | -- |
/// | Machine learning task | Regression |
/// | Is normalization required? | Yes |
/// | Is caching required? | No |
/// | Required NuGet in addition to Microsoft.ML | None |
///
/// ### Training Algorithm Details
/// Stochastic gradient descent uses a simple yet efficient iterative technique to fit model coefficients using error gradients for convex loss functions.
/// Online Gradient Descent (OGD) implements the standard (non-batch) SGD, with a choice of loss functions,
/// Online Gradient Descent (OGD) implements the standard (non-batch) stochastic gradient descent, with a choice of loss functions,
/// and an option to update the weight vector using the average of the vectors seen over time (averaged argument is set to True by default).
/// ]]>
/// </format>
/// </remarks>
/// <seealso cref="StandardTrainersCatalog.OnlineGradientDescent(RegressionCatalog.RegressionTrainers, string, string, IRegressionLoss, float, bool, float, int)"/>
/// <seealso cref="StandardTrainersCatalog.OnlineGradientDescent(RegressionCatalog.RegressionTrainers, OnlineGradientDescentTrainer.Options)"/>
/// <seealso cref="Options"/>
public sealed class OnlineGradientDescentTrainer : AveragedLinearTrainer<RegressionPredictionTransformer<LinearRegressionModelParameters>, LinearRegressionModelParameters>
{
internal const string LoadNameValue = "OnlineGradientDescent";
Expand All @@ -43,7 +61,8 @@ public sealed class OnlineGradientDescentTrainer : AveragedLinearTrainer<Regress
internal const string ShortName = "ogd";

/// <summary>
/// Options for the <see cref="OnlineGradientDescentTrainer"/>.
/// Options for the <see cref="OnlineGradientDescentTrainer"/> as used in
/// [OnlineGradientDescent(Options)](xref:Microsoft.ML.StandardTrainersCatalog.OnlineGradientDescent(Microsoft.ML.RegressionCatalog.RegressionTrainers,Microsoft.ML.Trainers.OnlineGradientDescentTrainer.Options)).
/// </summary>
public sealed class Options : AveragedLinearOptions
{
Expand Down
8 changes: 4 additions & 4 deletions src/Microsoft.ML.StandardTrainers/StandardTrainersCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,11 @@ public IClassificationLoss CreateComponent(IHostEnvironment env)
}

/// <summary>
/// Predict a target using a linear regression model trained with the <see cref="OnlineGradientDescentTrainer"/>.
/// Create <see cref="OnlineGradientDescentTrainer"/>, which predicts a target using a linear regression model.
/// </summary>
/// <param name="catalog">The regression catalog trainer object.</param>
/// <param name="labelColumnName">The name of the label column.</param>
/// <param name="featureColumnName">The name of the feature column.</param>
/// <param name="labelColumnName">The name of the label column. The column data must be <see cref="System.Single"/>.</param>
/// <param name="featureColumnName">The name of the feature column. The column data must be a known-sized vector of <see cref="System.Single"/>.</param>
/// <param name="lossFunction">The <a href="https://en.wikipedia.org/wiki/Loss_function">loss</a> function minimized in the training process. Using, for example, <see cref="SquaredLoss"/> leads to a least square trainer.</param>
/// <param name="learningRate">The initial learning rate used by SGD.</param>
/// <param name="decreaseLearningRate">Decrease learning rate as iterations progress.</param>
Expand Down Expand Up @@ -496,7 +496,7 @@ public static OnlineGradientDescentTrainer OnlineGradientDescent(this Regression
}

/// <summary>
/// Predict a target using a linear regression model trained with the <see cref="OnlineGradientDescentTrainer"/> and advanced options.
/// Create <see cref="OnlineGradientDescentTrainer"/> using advanced options, which predicts a target using a linear regression model.
/// </summary>
/// <param name="catalog">The regression catalog trainer object.</param>
/// <param name="options">Trainer options.</param>
Expand Down