private StringKeyedVector summedGradients = new StringKeyedVector();
@Override
public StringKeyedVector getUpdate(LabeledInstance instance) {
StringKeyedVector gradients = model.getGradients(instance);
StringKeyedVector updateVec = new StringKeyedVector();
Iterator<Map.Entry<String, Double>> it = gradients.iterator();
while (it.hasNext()) {
Map.Entry<String,Double> pairs = (Map.Entry)it.next();
String feature = pairs.getKey();
double gradient = pairs.getValue();
double featureLearningRate = updateAndGetFeatureLearningRate(feature, gradient);
updateVec.setCoordinate(feature, gradient * -featureLearningRate);
}
return updateVec;
}