/** * Initializing constructor. Sets all member variables to their associated settings in the * {@link StochasticGradientDescent.Parameters} object. * * @param n The name of the classifier. * @param p The settings of all parameters. **/ public StochasticGradientDescent(String n, Parameters p) { super(n); setParameters(p); }
/** * Calls the appropriate <code>Learner.setParameters(Parameters)</code> method for this * <code>Parameters</code> object. * * @param l The learner whose parameters will be set. **/ public void setParameters(Learner l) { ((StochasticGradientDescent) l).setParameters(this); }
/** * Use this constructor to specify an alternative subclass of {@link SparseWeightVector}. * * @param n The name of the classifier. * @param r The desired learning rate value. **/ public StochasticGradientDescent(String n, double r) { super(n); Parameters p = new Parameters(); p.learningRate = r; setParameters(p); }