Commit 2a8d38c5 authored by Qiwei Ye's avatar Qiwei Ye
Browse files

Merge branches 'master' and 'master' of https://github.com/Microsoft/LightGBM

parents 351b3d7e ed958eb2
This diff is collapsed.
...@@ -77,7 +77,7 @@ Linkers::~Linkers() { ...@@ -77,7 +77,7 @@ Linkers::~Linkers() {
} }
void Linkers::ParseMachineList(const char * filename) { void Linkers::ParseMachineList(const char * filename) {
TextReader<size_t> machine_list_reader(filename); TextReader<size_t> machine_list_reader(filename, false);
machine_list_reader.ReadAllLines(); machine_list_reader.ReadAllLines();
if (machine_list_reader.Lines().size() <= 0) { if (machine_list_reader.Lines().size() <= 0) {
Log::Fatal("Machine list file:%s doesn't exist", filename); Log::Fatal("Machine list file:%s doesn't exist", filename);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
namespace LightGBM { namespace LightGBM {
// static member defination // static member definition
int Network::num_machines_; int Network::num_machines_;
int Network::rank_; int Network::rank_;
Linkers* Network::linkers_; Linkers* Network::linkers_;
...@@ -141,7 +141,7 @@ void Network::ReduceScatter(char* input, int input_size, int* block_start, int* ...@@ -141,7 +141,7 @@ void Network::ReduceScatter(char* input, int input_size, int* block_start, int*
// send local data to neighbor first // send local data to neighbor first
linkers_->Send(recursive_halving_map_.neighbor, input, input_size); linkers_->Send(recursive_halving_map_.neighbor, input, input_size);
} else if (recursive_halving_map_.type == RecursiveHalvingNodeType::GroupLeader) { } else if (recursive_halving_map_.type == RecursiveHalvingNodeType::GroupLeader) {
// recieve neighbor data first // receive neighbor data first
int need_recv_cnt = input_size; int need_recv_cnt = input_size;
linkers_->Recv(recursive_halving_map_.neighbor, output, need_recv_cnt); linkers_->Recv(recursive_halving_map_.neighbor, output, need_recv_cnt);
// reduce // reduce
......
...@@ -155,7 +155,7 @@ public: ...@@ -155,7 +155,7 @@ public:
pAdapter = pAdapter->Next; pAdapter = pAdapter->Next;
} }
} else { } else {
Log::Error("GetAdaptersinfo error: code %d ", dwRetVal); Log::Fatal("GetAdaptersinfo error: code %d ", dwRetVal);
} }
if (pAdapterInfo) if (pAdapterInfo)
FREE(pAdapterInfo); FREE(pAdapterInfo);
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
namespace LightGBM { namespace LightGBM {
/*! /*!
* \brief Objective funtion for binary classification * \brief Objective function for binary classification
*/ */
class BinaryLogloss: public ObjectiveFunction { class BinaryLogloss: public ObjectiveFunction {
public: public:
explicit BinaryLogloss(const ObjectiveConfig& config) { explicit BinaryLogloss(const ObjectiveConfig& config) {
is_unbalance_ = config.is_unbalance; is_unbalance_ = config.is_unbalance;
sigmoid_ = static_cast<score_t>(config.sigmoid); sigmoid_ = static_cast<float>(config.sigmoid);
if (sigmoid_ <= 0.0) { if (sigmoid_ <= 0.0) {
Log::Fatal("Sigmoid parameter %f :should greater than zero", sigmoid_); Log::Fatal("Sigmoid parameter %f :should greater than zero", sigmoid_);
} }
...@@ -47,8 +47,8 @@ public: ...@@ -47,8 +47,8 @@ public:
label_weights_[1] = 1.0f; label_weights_[1] = 1.0f;
// if using unbalance, change the labels weight // if using unbalance, change the labels weight
if (is_unbalance_) { if (is_unbalance_) {
label_weights_[1] = 1.0f / cnt_positive; label_weights_[1] = 1.0f;
label_weights_[0] = 1.0f / cnt_negative; label_weights_[0] = static_cast<float>(cnt_positive) / cnt_negative;
} }
} }
...@@ -80,7 +80,7 @@ public: ...@@ -80,7 +80,7 @@ public:
} }
} }
double GetSigmoid() const override { float GetSigmoid() const override {
return sigmoid_; return sigmoid_;
} }
...@@ -92,11 +92,11 @@ private: ...@@ -92,11 +92,11 @@ private:
/*! \brief True if using unbalance training */ /*! \brief True if using unbalance training */
bool is_unbalance_; bool is_unbalance_;
/*! \brief Sigmoid parameter */ /*! \brief Sigmoid parameter */
score_t sigmoid_; float sigmoid_;
/*! \brief Values for positive and negative labels */ /*! \brief Values for positive and negative labels */
int label_val_[2]; int label_val_[2];
/*! \brief Weights for positive and negative labels */ /*! \brief Weights for positive and negative labels */
score_t label_weights_[2]; float label_weights_[2];
/*! \brief Weights for data */ /*! \brief Weights for data */
const float* weights_; const float* weights_;
}; };
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -77,9 +77,9 @@ private: ...@@ -77,9 +77,9 @@ private:
int* block_start_; int* block_start_;
/*! \brief Block size for reduce scatter */ /*! \brief Block size for reduce scatter */
int* block_len_; int* block_len_;
/*! \brief Write positions for feature histgrams */ /*! \brief Write positions for feature histograms */
int* buffer_write_start_pos_; int* buffer_write_start_pos_;
/*! \brief Read positions for local feature histgrams */ /*! \brief Read positions for local feature histograms */
int* buffer_read_start_pos_; int* buffer_read_start_pos_;
/*! \brief Size for reduce scatter */ /*! \brief Size for reduce scatter */
int reduce_scatter_size_; int reduce_scatter_size_;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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