bestFeatures.slowAddFeature(INDIRECT_GLOBAL_BIAS, 1.0);
@Override public double updateRepresentationCollection(WeightVector wv,AbstractStructureFinder struct_finder) throws Exception { IStructure abs = struct_finder.getBestStructure(wv, ins); FeatureVector bestFeatures = abs.getFeatureVector(); if (ahs != null && abs.equals(ahs)) return -1; // System.out.println("New Structures is ====================>"); // System.out.println(abs); // fv = bestFeatures; fv.normalize(ins.size()); // // adding a bias term for binary, important fv.slowAddFeature(INDIRECT_GLOBAL_BIAS, 1.0); ahs = abs; return Double.POSITIVE_INFINITY; }
public double predictLCLRBinaryScore(IStructure is, IInstance ins){ FeatureVector fv = is.getFeatureVector(); fv.normalize(ins.size()); fv.slowAddFeature(L2LossInstanceWithAlphas.INDIRECT_GLOBAL_BIAS, 1.0); return dotProduct(fv); }
fv.slowAddFeature( L2LossInstanceWithAlphas.INDIRECT_GLOBAL_BIAS, 1.0); double dot_product = cur_wv.dotProduct(fv);