Skip to content

Instantly share code, notes, and snippets.

@mrm1001
Created August 11, 2018 16:31
Show Gist options
  • Save mrm1001/66f9396c1e8cf348cec23ed1b6850b01 to your computer and use it in GitHub Desktop.
Save mrm1001/66f9396c1e8cf348cec23ed1b6850b01 to your computer and use it in GitHub Desktop.
FastText
if (args_->pretrainedVectors.size() != 0) {
loadVectors(args_->pretrainedVectors);
} else {
input_ = std::make_shared<Matrix>(dict_->nwords()+args_->bucket, args_->dim);
input_->uniform(1.0 / args_->dim);
}
if (args_->model == model_name::sup) {
output_ = std::make_shared<Matrix>(dict_->nlabels(), args_->dim);
} else {
output_ = std::make_shared<Matrix>(dict_->nwords(), args_->dim);
}
output_->zero();
startThreads();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment