Skip to content

Commit

Permalink
WIP uncommit me
Browse files Browse the repository at this point in the history
  • Loading branch information
thatlittleboy committed Nov 17, 2023
1 parent 7ba9aaa commit c70b94e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ while [ $# -gt 0 ]; do
shift
done

pip install --prefer-binary 'build>=0.10.0'
venv/bin/pip install --prefer-binary 'build>=0.10.0'

# create a new directory that just contains the files needed
# to build the Python package
Expand Down Expand Up @@ -362,12 +362,12 @@ if test "${INSTALL}" = true; then
echo "--- installing lightgbm ---"
# ref for use of '--find-links': https://stackoverflow.com/a/52481267/3986677
cd ../dist
pip install \
../venv/bin/pip install \
${PIP_INSTALL_ARGS} \
--force-reinstall \
--no-cache-dir \
--find-links=. \
lightgbm
lightgbm-*.whl
cd ../
fi

Expand Down
4 changes: 4 additions & 0 deletions python-package/lightgbm/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3661,6 +3661,7 @@ def update(
is_the_same_train_set = False
else:
is_the_same_train_set = train_set is self.train_set and self.train_set_version == train_set.version
print("t1")
if train_set is not None and not is_the_same_train_set:
if not isinstance(train_set, Dataset):
raise TypeError(f'Training data should be Dataset instance, met {type(train_set).__name__}')
Expand All @@ -3673,6 +3674,7 @@ def update(
self.train_set.construct()._handle))
self.__inner_predict_buffer[0] = None
self.train_set_version = self.train_set.version
print("t2")
is_finished = ctypes.c_int(0)
if fobj is None:
if self.__set_objective_to_none:
Expand All @@ -3682,10 +3684,12 @@ def update(
ctypes.byref(is_finished)))
self.__is_predicted_cur_iter = [False for _ in range(self.__num_dataset)]
return is_finished.value == 1
print("t3")
else:
if not self.__set_objective_to_none:
self.reset_parameter({"objective": "none"}).__set_objective_to_none = True
grad, hess = fobj(self.__inner_predict(0), self.train_set)
print("t4")
return self.__boost(grad, hess)

def __boost(
Expand Down
1 change: 1 addition & 0 deletions python-package/lightgbm/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def train(
booster.best_iteration = 0

# start training
print("t0")
for i in range(init_iteration, init_iteration + num_boost_round):
for cb in callbacks_before_iter:
cb(callback.CallbackEnv(model=booster,
Expand Down
1 change: 1 addition & 0 deletions src/boosting/gbdt_model_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ std::string GBDT::DumpModel(int start_iteration, int num_iteration, int feature_
Common::C_stringstream(str_buf);

str_buf << "{";
str_buf << "\"TESTING\":\"" << "HAHA_v2" << "\"," << '\n';
str_buf << "\"name\":\"" << SubModelName() << "\"," << '\n';
str_buf << "\"version\":\"" << kModelVersion << "\"," << '\n';
str_buf << "\"num_class\":" << num_class_ << "," << '\n';
Expand Down

0 comments on commit c70b94e

Please sign in to comment.