Skip to content

Instantly share code, notes, and snippets.

@szalai1
Created November 8, 2015 22:50
Show Gist options
  • Save szalai1/bc90fe210c62a3dbb6d2 to your computer and use it in GitHub Desktop.
Save szalai1/bc90fe210c62a3dbb6d2 to your computer and use it in GitHub Desktop.
model->userFactors->linCombine(recDat->user,-gradient*learningRate, model->itemFactors->get(recDat->item));
if (regularizationRate>0) {
model->itemFactors->linCombine(recDat->item,-regularizationRate*learningRate, model->itemFactors->get(recDat->item));
}
model->itemFactors->linCombine(recDat->item,-gradient*learningRate, &(model->tmpUserFactor));
if (regularizationRate>0) {
model->userFactors->linCombine(recDat->user,-regularizationRate*learningRate, &model->tmpUserFactor);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment