From 280345b0f8bd963f843e319dec147a69b67dfdc1 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Sun, 22 Jan 2017 22:21:51 +0000 Subject: [PATCH] batch-size -> mini-batch --- src/common/config.cpp | 4 ++-- src/common/decoder_main.cpp | 2 +- src/gpu/decoder/best_hyps.h | 6 +++--- src/gpu/dl4mt/decoder.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/config.cpp b/src/common/config.cpp index deea6a32..6dbbce57 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -202,7 +202,7 @@ void Config::AddOptions(size_t argc, char** argv) { ("cpu-threads", po::value()->default_value(1), "Number of threads on the CPU.") #endif - ("batch-size", po::value()->default_value(1), + ("mini-batch", po::value()->default_value(1), "Number of sentences in one batch.") ("bunch-size", po::value()->default_value(1), "Number of batches in one bunch.") @@ -285,7 +285,7 @@ void Config::AddOptions(size_t argc, char** argv) { SET_OPTION("no-debpe", bool); SET_OPTION("beam-size", size_t); SET_OPTION("cpu-threads", size_t); - SET_OPTION("batch-size", size_t); + SET_OPTION("mini-batch", size_t); SET_OPTION("bunch-size", size_t); #ifdef CUDA SET_OPTION("gpu-threads", size_t); diff --git a/src/common/decoder_main.cpp b/src/common/decoder_main.cpp index 516bd59a..21248a4c 100755 --- a/src/common/decoder_main.cpp +++ b/src/common/decoder_main.cpp @@ -26,7 +26,7 @@ int main(int argc, char* argv[]) { std::size_t taskCounter = 0; size_t bunchSize = god.Get("bunch-size"); - size_t maxBatchSize = god.Get("batch-size"); + size_t maxBatchSize = god.Get("mini-batch"); std::cerr << "mode=" << god.Get("mode") << std::endl; if (god.Get("wipo") || god.Get("cpu-threads")) { diff --git a/src/gpu/decoder/best_hyps.h b/src/gpu/decoder/best_hyps.h index 545995e6..4b51ab6f 100644 --- a/src/gpu/decoder/best_hyps.h +++ b/src/gpu/decoder/best_hyps.h @@ -18,10 +18,10 @@ class BestHyps : public BestHypsBase public: BestHyps(const BestHyps ©) = delete; BestHyps(const God &god) - : nthElement_(god.Get("beam-size"), god.Get("batch-size"), + : nthElement_(god.Get("beam-size"), god.Get("mini-batch"), mblas::CudaStreamHandler::GetStream()), - keys(god.Get("beam-size") * god.Get("batch-size")), - Costs(god.Get("beam-size") * god.Get("batch-size")), + keys(god.Get("beam-size") * god.Get("mini-batch")), + Costs(god.Get("beam-size") * god.Get("mini-batch")), weights_(god.GetScorerWeights()) { //std::cerr << "BestHyps::BestHyps" << std::endl; diff --git a/src/gpu/dl4mt/decoder.h b/src/gpu/dl4mt/decoder.h index 7d034852..98f925b4 100644 --- a/src/gpu/dl4mt/decoder.h +++ b/src/gpu/dl4mt/decoder.h @@ -101,7 +101,7 @@ class Decoder { Alignment(const God &god, const Weights& model) : w_(model), WC_(w_.C_(0,0)), - dBatchMapping_(god.Get("batch-size") * god.Get("beam-size"), 0) + dBatchMapping_(god.Get("mini-batch") * god.Get("beam-size"), 0) {} void Init(const mblas::Matrix& SourceContext) {