From: Aaron A. <aa...@us...> - 2008-08-15 21:42:02
|
Update of /cvsroot/jboost/jboost/src/jboost/booster In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv25194/src/jboost/booster Modified Files: YabaBoost.java Log Message: Small changes to YabaBoost Index: YabaBoost.java =================================================================== RCS file: /cvsroot/jboost/jboost/src/jboost/booster/YabaBoost.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** YabaBoost.java 10 Apr 2008 07:54:17 -0000 1.9 --- YabaBoost.java 15 Aug 2008 21:41:59 -0000 1.10 *************** *** 5,9 **** import jboost.booster.BrownBoost; import jboost.controller.Configuration; - import jboost.controller.ControllerConfiguration; import jboost.booster.MixedBinaryPrediction; --- 5,8 ---- *************** *** 104,109 **** nc = config.getDouble("nc", 0.15); setParams(c1,c2,theta,nc); ! if (config instanceof ControllerConfiguration && ! ((ControllerConfiguration) config).getCostSensitive()) { rpos = config.getDouble("pos_c",1.0); rneg = config.getDouble("neg_c",1.0); --- 103,108 ---- nc = config.getDouble("nc", 0.15); setParams(c1,c2,theta,nc); ! if (config instanceof Configuration && ! ((Configuration) config).getCostSensitive()) { rpos = config.getDouble("pos_c",1.0); rneg = config.getDouble("neg_c",1.0); *************** *** 472,503 **** System.err.println("Average potential difference is too big!"); /* ! m_s = m_oldS; ! System.err.println("Outputting all data to outfile!"); ! dump_everything(vars); ! s = m_c - m_s; ! double old_mu = m_theta - m_c1* ( Math.exp(-s) - Math.exp(-m_c) ); ! double theta_step = 0; ! if(vars.Potential-m_initialPotential > 0) { ! theta_step = - THETA_UPDATE_STEP; ! } else if(vars.Potential-m_initialPotential < 0) { ! theta_step = THETA_UPDATE_STEP/(Math.PI/3); // irrational number ! } ! m_theta += theta_step; ! m_c1 = m_c1 + theta_step / (Math.exp(-(0)) - Math.exp(-m_c)); ! double new_mu = m_theta - m_c1* ( Math.exp(-s) - Math.exp(-m_c) ); ! System.out.println("old_mu="+old_mu+", new_mu="+new_mu); ! double margin = 0; ! s = 0; ! double mu = m_theta - m_c1 * (Math.exp(-s) - Math.exp(-m_c)); ! double sd = Math.sqrt(m_c2 * (Math.exp(-2*s) - Math.exp(-2*m_c))) + FINISH_GAME_NOW; ! double pot = (1 - erf((margin-mu)/sd)) / 2; ! System.out.println("New potential is: " + pot); ! System.out.println("New intial potential is: " + calculatePotential(0, m_c)); ! System.out.println("New theta is:" + m_theta); ! return solve_constraints(hyp_err); */ --- 471,502 ---- System.err.println("Average potential difference is too big!"); /* ! m_s = m_oldS; ! System.err.println("Outputting all data to outfile!"); ! dump_everything(vars); ! s = m_c - m_s; ! double old_mu = m_theta - m_c1* ( Math.exp(-s) - Math.exp(-m_c) ); ! double theta_step = 0; ! if(vars.Potential-m_initialPotential > 0) { ! theta_step = - THETA_UPDATE_STEP; ! } else if(vars.Potential-m_initialPotential < 0) { ! theta_step = THETA_UPDATE_STEP/(Math.PI/3); // irrational number ! } ! m_theta += theta_step; ! m_c1 = m_c1 + theta_step / (Math.exp(-(0)) - Math.exp(-m_c)); ! double new_mu = m_theta - m_c1* ( Math.exp(-s) - Math.exp(-m_c) ); ! System.out.println("old_mu="+old_mu+", new_mu="+new_mu); ! double margin = 0; ! s = 0; ! double mu = m_theta - m_c1 * (Math.exp(-s) - Math.exp(-m_c)); ! double sd = Math.sqrt(m_c2 * (Math.exp(-2*s) - Math.exp(-2*m_c))) + FINISH_GAME_NOW; ! double pot = (1 - erf((margin-mu)/sd)) / 2; ! System.out.println("New potential is: " + pot); ! System.out.println("New intial potential is: " + calculatePotential(0, m_c)); ! System.out.println("New theta is:" + m_theta); ! return solve_constraints(hyp_err); */ *************** *** 678,682 **** double ret = norm * Math.exp(- Math.pow((margin-mu)/sd,2) / 2.0); if (USE_CONFIDENCE) { ! if (margin < mu) ret = 0; else ret = 2*ret; } --- 677,681 ---- double ret = norm * Math.exp(- Math.pow((margin-mu)/sd,2) / 2.0); if (USE_CONFIDENCE) { ! if (margin < mu) ret = 0; else ret = 2*ret; } *************** *** 729,743 **** } /* ! System.out.println("S:"+s); ! System.out.println("mu:"+mu); ! System.out.println("sd:"+sd); ! System.out.println("margin:"+margin); ! System.out.println("pot:"+pot); ! System.out.println("pot:"+ -(pot*2 -1)); System.out.println("YabaBoost:\n" ! + "\t m_c: " + m_c + "\n" ! + "\t m_c1: " + m_c1 + "\n" ! + "\t m_c2: " + m_c2 + "\n" ! + "\t m_theta: " + m_theta + "\n"); */ return pot; --- 728,742 ---- } /* ! System.out.println("S:"+s); ! System.out.println("mu:"+mu); ! System.out.println("sd:"+sd); ! System.out.println("margin:"+margin); ! System.out.println("pot:"+pot); ! System.out.println("pot:"+ -(pot*2 -1)); System.out.println("YabaBoost:\n" ! + "\t m_c: " + m_c + "\n" ! + "\t m_c1: " + m_c1 + "\n" ! + "\t m_c2: " + m_c2 + "\n" ! + "\t m_theta: " + m_theta + "\n"); */ return pot; |