"python-package/vscode:/vscode.git/clone" did not exist on "54f481ef774b99158b71d82e7eb71ad96983ac5b"
Commit 1aefcd8a authored by Hui Xue's avatar Hui Xue
Browse files

update for correct Init in DCGCalculator.

parent 6875983a
...@@ -80,7 +80,7 @@ void Application::LoadParameters(int argc, char** argv) { ...@@ -80,7 +80,7 @@ void Application::LoadParameters(int argc, char** argv) {
config_reader.ReadAllLines(); config_reader.ReadAllLines();
if (config_reader.Lines().size() > 0) { if (config_reader.Lines().size() > 0) {
for (auto& line : config_reader.Lines()) { for (auto& line : config_reader.Lines()) {
// remove str after # // remove str after "#"
if (line.size() > 0 && std::string::npos != line.find_first_of("#")) { if (line.size() > 0 && std::string::npos != line.find_first_of("#")) {
line.erase(line.find_first_of("#")); line.erase(line.find_first_of("#"));
} }
......
...@@ -21,7 +21,7 @@ void DCGCalculator::Init(std::vector<double> input_label_gain) { ...@@ -21,7 +21,7 @@ void DCGCalculator::Init(std::vector<double> input_label_gain) {
label_gain_ = input_label_gain; label_gain_ = input_label_gain;
discount_.clear(); discount_.clear();
for (data_size_t i = 0; i < kMaxPosition; ++i) { for (data_size_t i = 0; i < kMaxPosition; ++i) {
discount_.emplace_back(1.0 / std::log(2.0 + i)); discount_.emplace_back(1.0 / std::log2(2.0 + i));
} }
is_inited_ = true; is_inited_ = true;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment