!7 sclass Analyzer { static int baseSize = 1024; S word1, word2; Rect clip; // in baseSize*baseSize float threshold; S analyze(BWImage img) { ret clipBWImage(img, rescaleRect(clip, baseSize, baseSize, img.getWidth(), img.getHeight())).averageBrightness() >= threshold ? word1 : word2; } } static LPair images = new L; sS word1 = "yes", word2 = "no"; p-exp { L files = audioRecordingsWithSingleClip(); for (File f : allRecordings()) { S word = wordFromAudioFileName(f); if (!eqicOneOf(word, word1, word2)) continue; images.add(pair(word, bwAutoContrast(audio_clipFromLastEntryPoint(audioFileToFrequencyImage(f))))); print(fileName(f)); } showImage(second(random(images))); findBestAnalyzer(); } void findBestAnalyzer { final new Best best; final new AIStrategy_RandomWithVariation strategy; strategy.random = func -> Analyzer { randomAnalyzer() }; strategy.submit = func(final Analyzer a) -> double { new Scorer scorer; for (Pair img : images) scorer.add(eqic(img.a, analyzer.analyze(img.b))); if (best.put(r, scorer!)) print(scorer + " / " + sfu(a)); ret scorer!; }; thread { while licensed { strategy.go(); } }