Skip to content

Commit

Permalink
Fixed uninitialized result vector
Browse files Browse the repository at this point in the history
in kernel machine causing results to
be incorrect in case of batch evaluation
  • Loading branch information
lisitsyn committed Jul 7, 2012
1 parent d8d1b43 commit e510cf0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/shogun/machine/KernelMachine.cpp
Expand Up @@ -275,7 +275,6 @@ SGVector<float64_t> CKernelMachine::apply_get_outputs(CFeatures* data)

if (kernel->get_num_vec_rhs()>0)
{

SG_DEBUG( "computing output on %d test examples\n", num_vectors);

CSignal::clear_cancel();
Expand All @@ -288,6 +287,8 @@ SGVector<float64_t> CKernelMachine::apply_get_outputs(CFeatures* data)
if (kernel->has_property(KP_BATCHEVALUATION) &&
get_batch_computation_enabled())
{
output.zero();
SG_DEBUG("Batch evaluation enabled\n");
if (get_num_support_vectors()>0)
{
int32_t* sv_idx=SG_MALLOC(int32_t, get_num_support_vectors());
Expand Down

0 comments on commit e510cf0

Please sign in to comment.