Created
August 12, 2018 16:02
-
-
Save mrm1001/83a2f3b643666be97bf9750cb8a95dd7 to your computer and use it in GitHub Desktop.
FastText
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void FastText::supervised( | |
Model& model, | |
real lr, | |
const std::vector<int32_t>& line, | |
const std::vector<int32_t>& labels) { | |
if (labels.size() == 0 || line.size() == 0) return; | |
std::uniform_int_distribution<> uniform(0, labels.size() - 1); | |
int32_t i = uniform(model.rng); | |
model.update(line, labels[i], lr); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment