Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/vowpal_wabbit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Langford <jl@humpty.(none)>2010-12-05 05:06:31 +0300
committerJohn Langford <jl@humpty.(none)>2010-12-05 05:06:31 +0300
commitaafc1d817d5ee483b7e4bb23672e823032b56a95 (patch)
tree0fb1b48017f795163f34211e21f9739caec492ac
parent2281feea57f3a2d213c6fd5323b71e29092dcfe0 (diff)
bump to version 5.05.0
-rw-r--r--global_data.cc2
-rw-r--r--lda.cc11
2 files changed, 8 insertions, 5 deletions
diff --git a/global_data.cc b/global_data.cc
index 13ed3673..b297042d 100644
--- a/global_data.cc
+++ b/global_data.cc
@@ -6,7 +6,7 @@
#include "message_relay.h"
global_data global;
-string version = "4.2";
+string version = "5.0";
void binary_print_result(int f, float res, float weight, v_array<char> tag)
{
diff --git a/lda.cc b/lda.cc
index 1c565927..71954a2c 100644
--- a/lda.cc
+++ b/lda.cc
@@ -145,7 +145,8 @@ void lda_loop(float* v,weight* weights,example* ec, float power_t)
while (average_diff(old_gamma, new_gamma) > 0.1);
ec->topic_predictions.erase();
- reserve(ec->topic_predictions,global.lda);
+ if (ec->topic_predictions.end_array - ec->topic_predictions.begin < (int)global.lda)
+ reserve(ec->topic_predictions,global.lda);
memcpy(ec->topic_predictions.begin,new_gamma,global.lda*sizeof(float));
}
@@ -160,7 +161,8 @@ void merge_pair(v_array<index_triple>& source, v_array<index_triple>& dest)
{
size_t dest_size = dest.index();
size_t limit = source.index()+dest_size;
- reserve(dest,limit);
+ if (dest.end_array - dest.begin < (int)limit)
+ reserve(dest,limit);
memmove(dest.begin+source.index(),dest.begin,dest_size*sizeof(index_triple));
dest.end = dest.begin+limit;
@@ -217,12 +219,13 @@ void bubble_sort(feature* f0, feature*f1) {
void merge_in(example* ec, size_t document)
{
size_t next_index = merge_set.index();
- reserve(merge_set,next_index+ec->indices.index());
+ if ((int)(next_index + ec->indices.index()) > merge_set.end_array-merge_set.begin)
+ reserve(merge_set,next_index+ec->indices.index());
merge_set.end = merge_set.begin+next_index+ec->indices.index();
for (size_t* i = ec->indices.begin; i != ec->indices.end; i++)
{
feature* f = ec->subsets[*i][0];
- bubble_sort(f, ec->subsets[*i][1]);
+ //bubble_sort(f, ec->subsets[*i][1]); use --sort_features
for (; f != ec->subsets[*i][1]; f++)
{
index_triple temp = {document,*f};