+ extended evaluation function to return positionwise deviations
[qpalma.git] / qpalma / SIQP.py
index 3b015fc..08e51f6 100644 (file)
@@ -72,6 +72,8 @@ class SIQP:
       totalQualSP = Configuration.totalQualSuppPoints
       numQPlifs = Configuration.numQualPlifs 
 
+      regC = self.numFeatures / 1.0*self.numExamples
+
       for j in range(lengthSP-1):
          self.P[j,j+1] = -1.0 
          self.P[j+1,j] = -1.0
@@ -97,6 +99,30 @@ class SIQP:
             self.P[j+1,j] = -1.0
             self.P[j,j] += 1.0
 
+      # 0.25 for each was already good
+
+      lengthGroupParam  = 0.005
+      spliceGroupParam  = 0.005
+
+      matchGroupParam   = 0.495
+      qualityGroupParam = 0.495
+
+      self.P[0:lengthSP,0:lengthSP] *= lengthGroupParam
+
+      beg = lengthSP
+      end = lengthSP+donSP+accSP
+      self.P[beg:end,beg:end]       *= spliceGroupParam
+
+      beg = lengthSP+donSP+accSP
+      end = lengthSP+donSP+accSP+mmatrixSP
+      self.P[beg:end,beg:end]       *= matchGroupParam
+
+      beg = lengthSP+donSP+accSP+mmatrixSP
+      self.P[beg:-self.numExamples,beg:-self.numExamples]   *= qualityGroupParam
+
+      self.P[0:-self.numExamples,0:-self.numExamples]       *= regC*1e-3
+
+
    def createRegularizer(self):
       #self.createUnitRegularizer()
       self.createSmoothnessRegularizer()