Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Resolved HistogramWordStringKernel testsuite issue
  • Loading branch information
lisitsyn committed Sep 4, 2011
1 parent 4c6174c commit d744130
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/shogun/kernel/HistogramWordStringKernel.cpp
Expand Up @@ -115,7 +115,7 @@ bool CHistogramWordStringKernel::init(CFeatures* p_l, CFeatures* p_r)
float64_t* l_plo_rhs=plo_rhs;
float64_t* l_ld_mean_lhs=ld_mean_lhs;
float64_t* l_ld_mean_rhs=ld_mean_rhs;

//from our knowledge first normalize variance to 1 and then norm=1 does the job
if (!initialized)
{
Expand Down Expand Up @@ -227,15 +227,15 @@ bool CHistogramWordStringKernel::init(CFeatures* p_l, CFeatures* p_r)
float64_t result=0 ;
for (int32_t j=0; j<alen; j++)
{
int32_t a_idx = compute_index(j, avec[j]) ;
int32_t a_idx = compute_index(j, avec[j]);
result -= estimate->log_derivative_pos_obsolete(avec[j], j)*mean[a_idx]/variance[a_idx] ;
result -= estimate->log_derivative_neg_obsolete(avec[j], j)*mean[a_idx+num_params]/variance[a_idx+num_params] ;
}
ld_mean_lhs[i]=result ;

// precompute posterior-log-odds
plo_lhs[i] = estimate->posterior_log_odds_obsolete(avec, alen)-mean[0] ;
l->free_feature_vector(avec, alen, free_avec);
l->free_feature_vector(avec, i, free_avec);
} ;

if (ld_mean_lhs!=ld_mean_rhs)
Expand All @@ -260,7 +260,7 @@ bool CHistogramWordStringKernel::init(CFeatures* p_l, CFeatures* p_r)

// precompute posterior-log-odds
plo_rhs[i] = estimate->posterior_log_odds_obsolete(avec, alen)-mean[0] ;
r->free_feature_vector(avec, alen, free_avec);
r->free_feature_vector(avec, i, free_avec);
} ;
} ;

Expand Down

0 comments on commit d744130

Please sign in to comment.