Changeset 4302


Ignore:
Timestamp:
08/11/08 02:53:10 (12 years ago)
Author:
nor
Message:
  • Fixed issue where pressing stop button would not stop iteration
  • Reduced initial burnin iterations to 10.
  • Changed text on iteration progress bar to include worst RCSE
  • Modified Renderer API to be able to retrieve RCSE
  • Added an rcse cache to BurnInRenderer, to dramatically lower time

spent in that calculation routine

Location:
trunk/loci/slim
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/slim/BurnInRenderer.java

    r4250 r4302  
    4646  private boolean estimated; 
    4747  private boolean improving; 
     48  private double[][] rcsecache; 
     49  private double worstRCSE; 
    4850 
    4951  public BurnInRenderer(CurveCollection cc) { 
     
    7173    improving = false; 
    7274    setComponentCount(1); 
     75    rcsecache = new double[maxDim][maxDim]; 
    7376  } 
    7477 
     
    101104          // END HACKY CRAP 
    102105          currentCurves[currentY][currentX].estimate(); 
     106          //currentCurves[currentY][currentX].iterate(); 
    103107          double[][] curve = currentCurves[currentY][currentX].getCurve(); 
    104108          double[] exponentials = new double[numExponentials]; 
     
    148152        maxProgress = maxDim * maxDim; 
    149153      } 
    150       for(; currentX < maxDim || !alive; currentX++) { 
    151         for(; currentY < maxDim || !alive; currentY++) { 
     154      for(; currentX < maxDim; currentX++) { 
     155        for(; currentY < maxDim; currentY++) { 
    152156          currentIterations = 0; 
    153157          currProgress = (currentX * maxDim) + currentY; 
     
    157161            double currRCSE = currentCurves[currentY][currentX].getReducedChiSquaredError(); 
    158162            currentCurves[currentY][currentX].iterate(); 
    159             if(currentCurves[currentY][currentX].getReducedChiSquaredError() < currRCSE) { 
    160               if(currentCurves[currentY][currentX].getReducedChiSquaredError() < maxRCSE) { 
     163            double newRCSE = currentCurves[currentY][currentX].getReducedChiSquaredError(); 
     164            rcsecache[currentY][currentX] = newRCSE; 
     165            if(newRCSE < currRCSE) { 
     166              if(newRCSE < maxRCSE) { 
    161167                currentIterations = maxIterations; 
    162168              } 
     
    172178              } 
    173179            } 
     180            if(!alive) return; 
    174181          } 
    175182        } 
     
    189196      for(int x = 0; x < maxDim; x++) { 
    190197        for(int y = 0; y < maxDim; y++) { 
    191           if(currentCurves[y][x].getReducedChiSquaredError() > worstval) { 
    192             worstval = currentCurves[y][x].getReducedChiSquaredError(); 
     198          if(rcsecache[y][x] > worstval) { 
     199            worstval = rcsecache[y][x]; 
    193200            worstx = x; 
    194201            worsty = y; 
     
    196203        } 
    197204      } 
     205      worstRCSE = worstval; 
    198206      currentX = worstx; 
    199207      currentY = worsty; 
    200208      currentCurves[currentY][currentX].iterate(); 
     209      totalIterations++; 
     210      rcsecache[currentY][currentX] = currentCurves[currentY][currentX].getReducedChiSquaredError(); 
     211      //System.out.println("x: " + currentX + "  y: " + currentY + "   RCSE: " + currentCurves[currentY][currentX].getReducedChiSquaredError()); 
    201212    } 
    202213  } 
     
    214225  } 
    215226 
     227  public double getWorstRCSE() { 
     228    return worstRCSE; 
     229  } 
     230 
    216231} 
  • trunk/loci/slim/GACurveFitter.java

    r4288 r4302  
    411411        } 
    412412      } 
    413       System.out.println("maxIndex: " + maxIndex + "  minIndex: " + minIndex); 
     413      //System.out.println("maxIndex: " + maxIndex + "  minIndex: " + minIndex); 
    414414      // If we have valid min and max data, perform the "estimate" 
    415415      double expguess = -1; 
     
    441441        expguess = 1; 
    442442      } 
    443       System.out.println("Estimating: " + expguess); 
    444       System.out.println("maxData: " + maxData + "  firstindex: " + firstindex + "  data: " + curveData[firstindex]); 
     443      //System.out.println("Estimating: " + expguess); 
     444      //System.out.println("maxData: " + maxData + "  firstindex: " + firstindex + "  data: " + curveData[firstindex]); 
    445445      if(components == 1) { 
    446446        curveEstimate[0][0] = maxData - minData; 
  • trunk/loci/slim/Renderer.java

    r4235 r4302  
    113113  public abstract int getImageY(); 
    114114 
     115  public abstract double getWorstRCSE(); 
    115116} 
  • trunk/loci/slim/TwoDPane.java

    r4250 r4302  
    315315      curveRenderers[c] = new BurnInRenderer(data.curves[c]); 
    316316      curveRenderers[c].setComponentCount(data.numExp); 
    317       curveRenderers[c].setMaxIterations(100); 
     317      curveRenderers[c].setMaxIterations(10); /* TEMP */ 
     318       
    318319    } 
    319320    int delay = RATE; 
     
    374375      if (curProg == maxProg) { 
    375376        int totalIter = curveRenderers[c].getTotalIterations(); 
    376         progress.setString("Improving image: iteration #" + totalIter); 
     377        double wRCSE = curveRenderers[c].getWorstRCSE(); 
     378        wRCSE = ((int) (wRCSE * 100)) / 100.0; 
     379        progress.setString("Improving image: iter. #" + totalIter + 
     380             " Worst RCSE: " + wRCSE); 
    377381      } 
    378382      else { 
Note: See TracChangeset for help on using the changeset viewer.