Examples of PatternList


Examples of com.digiburo.backprop1b.network.PatternList

  /**
   * Read and return the ASCII pattern files as Pattern objects.
   */
  public void createTrainingSet() throws Exception {
    PatternList pl = new PatternList();

    double input[] = null;
    double output[] = new double[10];

    for (int ii = 0; ii < RAW_FILENAMES.length; ii++) {
      output[ii] = zero;
    }

    for (int ii = 0; ii < RAW_FILENAMES.length; ii++) {
      System.out.println(RAW_FILENAMES[ii]);
      input = patternReader(FILE_PATH + RAW_FILENAMES[ii]);
      if (ii == 0) {
        output[ii] = one;
      } else {
        output[ii] = one;
        output[ii - 1] = zero;
      }

      pl.add(input, output);
    }

    pl.writer(new File(TRAIN_FILENAME));
  }
View Full Code Here

Examples of com.digiburo.backprop1b.network.PatternList

    /**
     * Load training datum
     * @param datum training file
     */
    public int loadTraining(File datum) throws IOException, FileNotFoundException, ClassNotFoundException {
      pl = new PatternList();
      pl.reader(datum);
      return(pl.size());
    }
View Full Code Here

Examples of com.digiburo.backprop1b.network.PatternList

    /**
     * Load training datum
     * @param datum training file
     */
    public int loadTraining(File datum) throws IOException, FileNotFoundException, ClassNotFoundException {
      pl = new PatternList();
      pl.reader(datum);
      return(pl.size());
    }
View Full Code Here

Examples of com.digiburo.backprop1b.network.PatternList

   */
  public static void main(String args[]) throws Exception {
    System.out.println("begin");

    BpDemo3 bd3 = null;
    PatternList training = null;

    training = new PatternList();
    training.reader(new File(TRAIN_FILENAME));

    if (args.length == 0) {
      bd3 = new BpDemo3(new File(NETWORK_FILENAME));
    } else {
      bd3 = new BpDemo3(new File(args[0]));
View Full Code Here

Examples of com.digiburo.backprop1b.network.PatternList

  /**
     *
     */
  public void patternReader(String file_name) throws Exception {
    pl = new PatternList();
    pl.reader(new File(file_name));

    int limit = pl.size();

    // write above answers
View Full Code Here

Examples of com.digiburo.backprop1b.network.PatternList

  /**
   * Create training datum
   */
  public int loadTraining() throws IOException, FileNotFoundException, ClassNotFoundException {
    pl = new PatternList();

    double[] input = new double[2];
    double[] output = new double[1];

    input[0] = ZERO;
View Full Code Here

Examples of net.sourceforge.processdash.util.PatternList

        else
            return new BufferedInputStream(srcZip.getInputStream(e));
    }
   
    public List<ZipEntry> getEntries(String... patterns) {
        PatternList p = new PatternList(patterns);
        List<ZipEntry> result = new ArrayList<ZipEntry>();
        Enumeration<? extends ZipEntry> entries = srcZip.entries();
        while (entries.hasMoreElements()) {
            ZipEntry e = entries.nextElement();
            if (p.matches(e.getName()))
                result.add(e);
        }
        return result;
    }
View Full Code Here

Examples of net.sourceforge.processdash.util.PatternList

   
    public void disableBaselineData() {
        setBaselineDataSource(null);
        showBaselineColumns = false;
        schedule.getMetrics().discardMetrics(
            new PatternList().addRegexp("Baseline"));
    }
View Full Code Here

Examples of net.sourceforge.processdash.util.PatternList

    private PatternList setupPatterns(List regexps) {
        if (regexps == null || regexps.isEmpty())
            return null;
        else {
            PatternList result = new PatternList();
            for (Iterator iter = regexps.iterator(); iter.hasNext();) {
                String re = (String) iter.next();
                int bracePos = re.indexOf('}');
                if (bracePos != -1 && re.startsWith("{"))
                    re = re.substring(bracePos + 1);
                try {
                    result.addRegexp(re);
                } catch (Exception e) {
                    logger.log(Level.WARNING, "Bad regular expression ''{0}''",
                            re);
                }
            }
View Full Code Here

Examples of net.sourceforge.processdash.util.PatternList

                }};
            return result;
        }
        private Map enumerateNames(Collection namePatterns) {
            PatternList pl = new PatternList();
            for (Iterator i = namePatterns.iterator(); i.hasNext();)
                pl.addRegexp(fixupPattern((String) i.next()));
           
            if (pl.getContainsItems() != null || pl.getRegexpItems() != null
                    || pl.getStartsWithItems() != null
                    || pl.getEqualsItems() != null)
                throw new UnsupportedOperationException();
           
            Map result = new HashMap();
            for (Iterator i = pl.getEndsWithItems().iterator(); i.hasNext();) {
                String oneItem = (String) i.next();
                String rootTag = null;
                int tagEnd = oneItem.indexOf(TAG_SEP_CHAR);
                if (tagEnd != -1) {
                    rootTag = oneItem.substring(0, tagEnd);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.