Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aksnzhy committed Mar 8, 2018
1 parent 505e105 commit 6b02eb5
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 20 deletions.
2 changes: 1 addition & 1 deletion doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You will see: ::
> <| |___| __/ (_| | | | | | |
/_/\_\_____/\___|\__,_|_| |_| |_|

xLearn -- 0.10 Version --
xLearn -- 0.30 Version --
-------------------------------------------------------------------------

If you want to build the latest code from `Github`__, or you want to use the xLearn command line
Expand Down
7 changes: 7 additions & 0 deletions doc/news.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## News

- 08/03/2018 xLearn 0.3.0 version release. Main update:

* Fix bugs in previous version
* Solved the memory leak problem for on-disk learning
* Support dump TXT model to checkpoint
* Support Scikit-Learn API

- 18/12/2017 xLearn 0.2.0 version release. Main update:

* Fix bugs in previous version
Expand Down
2 changes: 1 addition & 1 deletion doc/python_package.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ If you install xLearn Python package successfully, you will see ::
> <| |___| __/ (_| | | | | | |
/_/\_\_____/\___|\__,_|_| |_| |_|

xLearn -- 0.20 Version --
xLearn -- 0.30 Version --
-------------------------------------------------------------------------

Quick Start
Expand Down
3 changes: 2 additions & 1 deletion doc/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ This is the roadmap of xLearn for the next step. Please join us and push your co
- Pip installation (*Done*)
- Sparse-aware distributed learning (*In Progress*)
- Better support for numpy/pandas (*In Progress*)
- Support scikit-learn API (*In Progress*)
- Support scikit-learn API (*Done*)
- Better support for Juyter notebook (*Not begin*)
2 changes: 1 addition & 1 deletion python-package/xlearn/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.0
0.3.0
2 changes: 1 addition & 1 deletion src/c_api/c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ XL_DLL int XLearnHello() {
" \\ \\/ / | / _ \\/ _` | '__| '_ \\ \n"
" > <| |___| __/ (_| | | | | | |\n"
" /_/\\_\\_____/\\___|\\__,_|_| |_| |_|\n\n"
" xLearn -- 0.20 Version --\n"
" xLearn -- 0.30 Version --\n"
"----------------------------------------------------------------------------------------------\n"
"\n";
Color::Modifier green(Color::FG_GREEN);
Expand Down
21 changes: 10 additions & 11 deletions src/data/data_structure.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ const int kAlignByte = 16;
// will be printed for users during the training.
//------------------------------------------------------------------------------
struct MetricInfo {
real_t loss_val; /* Loss info */
real_t metric_val; /* Metric info */
real_t loss_val; /* Loss value */
real_t metric_val; /* Metric value */
};

//------------------------------------------------------------------------------
// Node is used to store information for each column of the feature vector.
// For tasks like lr and fm, we just need to store the feature id and the
// feature value. While for tasks like ffm, we also need to store the field id.
// For tasks like LR and FM, we just need to store the feature id and the
// feature value. While for tasks like FFM, we also need to store field id.
//------------------------------------------------------------------------------
struct Node {
// Default constructor
Expand All @@ -79,11 +79,11 @@ struct Node {
feat_id(feat),
feat_val(val) { }
/* Field id is start from 0 */
index_t field_id;
index_t field_id;
/* Feature id is start from 0 */
index_t feat_id;
index_t feat_id;
/* Feature value */
real_t feat_val;
real_t feat_val;
};

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -403,10 +403,9 @@ struct DMatrix {
return max;
}

/* The DMatrix has a hash value that is
geneerated from the txt file.
These two values are used to check whether
we can use binary file to speedup data reading */
/* The DMatrix has a hash value that is geneerated
from the txt file. These two values are used to check
whether we can use binary file to speedup data reading */
uint64 hash_value_1;
uint64 hash_value_2;
/* Row length of current matrix */
Expand Down
5 changes: 4 additions & 1 deletion src/reader/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ class OndiskReader : public Reader {
OndiskReader()
: block_size_(500) { } /* 500 MB on default */
~OndiskReader() {
Clear();
Close(file_ptr_);
}

Expand All @@ -226,7 +227,9 @@ class OndiskReader : public Reader {
// Free the memory of data matrix.
virtual void Clear() {
data_samples_.Release();
delete [] block_;
if (block_ != nullptr) {
delete [] block_;
}
}

// We cannot set shuffle for OndiskReader
Expand Down
1 change: 0 additions & 1 deletion src/reader/reader_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ void read_from_disk(const std::string& filename, int task_id) {
DMatrix* matrix = new DMatrix;
for (int i = 0; i < iteration_num; ++i) {
int record_num = reader.Samples(matrix);
//std::cout << i << std::endl;
if (record_num == 0) {
--i;
reader.Reset();
Expand Down
4 changes: 2 additions & 2 deletions src/solver/solver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace xLearn {
// > <| |___| __/ (_| | | | | | |
// /_/\_\______\___|\__,_|_| |_| |_|
//
// xLearn -- 0.10 Version --
// xLearn -- 0.30 Version --
//------------------------------------------------------------------------------
void Solver::print_logo() const {
std::string logo =
Expand All @@ -54,7 +54,7 @@ void Solver::print_logo() const {
" \\ \\/ / | / _ \\/ _` | '__| '_ \\ \n"
" > <| |___| __/ (_| | | | | | |\n"
" /_/\\_\\_____/\\___|\\__,_|_| |_| |_|\n\n"
" xLearn -- 0.20 Version --\n"
" xLearn -- 0.30 Version --\n"
"----------------------------------------------------------------------------------------------\n"
"\n";
Color::Modifier green(Color::FG_GREEN);
Expand Down

0 comments on commit 6b02eb5

Please sign in to comment.