Skip to content

Commit

Permalink
update lock_free
Browse files Browse the repository at this point in the history
  • Loading branch information
aksnzhy committed Nov 21, 2017
1 parent 5756651 commit 9e02569
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions python-package/xlearn/xlearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ def disableNorm(self):
_check_call(_LIB.XLearnSetBool(ctypes.byref(self.handle),
c_str(key), ctypes.c_bool(False)))

def setLockFree(self):
"""Set xlearn to use lock free training"""
def disLockFree(self):
"""Disable lock free training"""
key = 'lock_free'
_check_call(_LIB.XLearnSetBool(ctypes.byref(self.handle),
c_str(key), ctypes.c_bool(True)))
c_str(key), ctypes.c_bool(False)))

def disableEarlyStop(self):
"""Disable early-stopping"""
Expand Down
2 changes: 1 addition & 1 deletion src/data/hyper_parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct HyperParam {
normalization, and False for not */
bool norm = true;
/* Using lock-free AdaGard to accelerate training */
bool lock_free = false;
bool lock_free = true;
//------------------------------------------------------------------------------
// Parameters for dataset
//------------------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions src/solver/checker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ std::string Checker::option_help() const {
" --cv : Open cross-validation in training tasks. If we use this option, xLearn \n"
" will ignore the validation file (-t). \n"
" \n"
" --lock-free : Open lock-free training. Lock-free training can accelerate training but \n"
" --dis-lock-free : Disable lock-free training. Lock-free training can accelerate training but \n"
" the result is non-deterministic. Our suggestion is that you can open this flag \n"
" if the training data is bigger than 200MB. \n"
" if the training data is big and sparse. \n"
" \n"
" --dis-es : Disable early-stopping in training. By default, xLearn will use early-stopping \n"
" in training tasks, except for training in cross-validation. \n"
Expand Down Expand Up @@ -371,8 +371,8 @@ bool Checker::check_train_options(HyperParam& hyper_param) {
} else if (list[i].compare("--cv") == 0) { // cross-validation
hyper_param.cross_validation = true;
i += 1;
} else if (list[i].compare("--lock-free") == 0) { // lock-free training
hyper_param.lock_free = true;
} else if (list[i].compare("--dis-lock-free") == 0) { // lock-free training
hyper_param.lock_free = false;
i += 1;
} else if (list[i].compare("--dis-es") == 0) { // disable early-stop
hyper_param.early_stop = false;
Expand Down

0 comments on commit 9e02569

Please sign in to comment.