Class LinearSGDModel

All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.provenance.Provenancable<ModelProvenance>, Serializable, ONNXExportable

public class LinearSGDModel extends AbstractLinearSGDModel<Regressor> implements ONNXExportable
The inference time version of a linear model trained using SGD. The output dimensions are independent, unless they are tied together by the optimiser.

See:

 Bottou L.
 "Large-Scale Machine Learning with Stochastic Gradient Descent"
 Proceedings of COMPSTAT, 2010.
 
See Also:
  • Method Details

    • predict

      public Prediction<Regressor> predict(Example<Regressor> example)
      Description copied from class: Model
      Uses the model to predict the output for a single example.

      predict does not mutate the example.

      Throws IllegalArgumentException if the example has no features or no feature overlap with the model.

      Specified by:
      predict in class Model<Regressor>
      Parameters:
      example - the example to predict.
      Returns:
      the result of the prediction.
    • copy

      protected LinearSGDModel copy(String newName, ModelProvenance newProvenance)
      Description copied from class: Model
      Copies a model, replacing its provenance and name with the supplied values.

      Used to provide the provenance removal functionality.

      Specified by:
      copy in class Model<Regressor>
      Parameters:
      newName - The new name.
      newProvenance - The new provenance.
      Returns:
      A copy of the model.
    • getDimensionName

      protected String getDimensionName(int index)
      Description copied from class: AbstractLinearSGDModel
      Gets the name of the indexed output dimension.
      Specified by:
      getDimensionName in class AbstractLinearSGDModel<Regressor>
      Parameters:
      index - The output dimension index.
      Returns:
      The name of the requested output dimension.
    • onnxOutput

      protected ONNXNode onnxOutput(ONNXNode input)
      Description copied from class: AbstractLinearSGDModel
      Takes the unnormalized ONNX output of this model and applies an appropriate normalizer from the concrete class.
      Specified by:
      onnxOutput in class AbstractLinearSGDModel<Regressor>
      Parameters:
      input - Unnormalized ONNX leaf node.
      Returns:
      Normalized ONNX leaf node.
    • onnxModelName

      protected String onnxModelName()
      Specified by:
      onnxModelName in class AbstractLinearSGDModel<Regressor>
      Returns:
      Name to write into the ONNX Model.