use of gdsc.smlm.search.SearchResult in project GDSC-SMLM by aherbert.
the class BenchmarkFilterAnalysis method score.
public SearchResult<FilterScore>[] score(double[][] points) {
ga_iteration++;
SimpleFilterScore max = es_optimum;
final FilterScoreResult[] scoreResults = scoreFilters(setStrength(new FilterSet(searchSpaceToFilters(points))), false);
if (scoreResults == null)
return null;
@SuppressWarnings("unchecked") SearchResult<FilterScore>[] scores = new SearchResult[scoreResults.length];
for (int index = 0; index < scoreResults.length; index++) {
final FilterScoreResult scoreResult = scoreResults[index];
final SimpleFilterScore result = new SimpleFilterScore(scoreResult, true, scoreResult.criteria >= minCriteria);
if (result.compareTo(max) < 0) {
max = result;
}
scores[index] = new SearchResult<FilterScore>(result.r.filter.getParameters(), result);
}
es_optimum = max;
// Add the best filter to the table
// This filter may not have been part of the scored subset so use the entire results set for reporting
DirectFilter filter = max.r.filter;
FractionClassificationResult r = scoreFilter(filter, minimalFilter, ga_resultsList, coordinateStore);
final StringBuilder text = createResult(filter, r);
add(text, ga_iteration);
gaWindow.append(text.toString());
return scores;
}
use of gdsc.smlm.search.SearchResult in project GDSC-SMLM by aherbert.
the class BenchmarkFilterAnalysis method findOptimum.
public SearchResult<FilterScore> findOptimum(double[][] points) {
ga_iteration++;
SimpleFilterScore max = es_optimum;
final FilterScoreResult[] scoreResults = scoreFilters(setStrength(new FilterSet(searchSpaceToFilters(points))), false);
if (scoreResults == null)
return null;
for (int index = 0; index < scoreResults.length; index++) {
final FilterScoreResult scoreResult = scoreResults[index];
final SimpleFilterScore result = new SimpleFilterScore(scoreResult, true, scoreResult.criteria >= minCriteria);
if (result.compareTo(max) < 0) {
max = result;
}
}
es_optimum = max;
// Add the best filter to the table
// This filter may not have been part of the scored subset so use the entire results set for reporting
DirectFilter filter = max.r.filter;
FractionClassificationResult r = scoreFilter(filter, minimalFilter, ga_resultsList, coordinateStore);
final StringBuilder text = createResult(filter, r);
add(text, ga_iteration);
gaWindow.append(text.toString());
return new SearchResult<FilterScore>(filter.getParameters(), max);
}
Aggregations