|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.ai.scorer.ScorerCreator
public final class ScorerCreator
Creates new Scorer (parameter-set) instances given an existing population.
| Nested Class Summary | |
|---|---|
static class |
ScorerCreator.ScorerWork
Class to encapsulate all background and evolution work for a given ScorerCache. |
| Field Summary | |
|---|---|
static java.lang.String |
DT__GEN_DATA
Data type parameter name for generic data/query; never null nor empty. |
static java.lang.String |
DT_BESTSC
Data type parameter value to request server's best Scorers; never null nor empty. |
static java.lang.String |
DT_CALIB
Data type parameter value to request calibration-set data; never null nor empty. |
static java.lang.String |
DT_PARAM_NAME
Parameter name to request particular remote data type; never null nor empty. |
static java.lang.String |
DT_POSTNEWSC
Data type parameter value to POST new 'star' Scorer; never null nor empty. |
static int |
MIN_SUGGESTED_CALIB_SET_SIZE
Minimum suggested calibration-set size; strictly positive. |
private static boolean |
PERF_SAMPLE_CW
If true then monitor and report performance (CPU usage) in computeWeighting(). |
private static java.util.concurrent.ConcurrentHashMap<java.lang.StackTraceElement,java.util.concurrent.atomic.AtomicInteger> |
perfCountsCW
Cumulative performance stats (if any) for computeWeighting(); null iff none being collected. |
static java.lang.String |
scorerTunnelRRURL
Tunnel root-relative (starting with '/') URL within the server; never null. |
static java.lang.String |
SSOURCE_GA
Scorer 'source' for the GA combine/mutate method; never empty nor null. |
static java.lang.String |
SSOURCE_MIN
Scorer 'source' for the "minimiser" method; never empty nor null. |
static java.lang.String |
SSOURCE_REC
Scorer 'source' for recovering from persistent/shared store; never empty nor null. |
static int |
SUGGESTED_CALIB_SET_SIZE
Server-side calibration set size; strictly positive and no less than MIN_SUGGESTED_CALIB_SET_SIZE. |
| Constructor Summary | |
|---|---|
ScorerCreator()
|
|
| Method Summary | |
|---|---|
static ScoreAndConf |
computeWeighting(java.util.Map<Name.ExhibitShort,ScoreAndConf> scorerResult,
java.util.Map<Name.ExhibitShort,ScoreAndConf> calibrationData)
Computes ScoreAndConf over the supplied calibration exhibits; never null but may be (0,0) where the scorer is unknown or untested. |
static Tuple.Pair<ScoreAndConf,java.lang.Boolean> |
computeWeighting(java.util.Map<Name.ExhibitShort,ScoreAndConf> calibrationData,
ScorerCacheIF scorerCache,
ScorerIF scorer,
AllExhibitImmutableData aeid,
boolean allowStale)
Computes ScoreAndConf over the supplied calibration exhibits using the supplied Scorer cache; never null but may be (0,0) where the scorer is unknown or untested. |
private static ScorerIF |
constructModifiedSNP(double[] par,
ScorerIF initialScorer,
java.util.List<ScorerParam> paramDefsAndValuesOriginal,
int[] mnIndexToParamIndex)
Create a variant Scorer given an extant same-type Scorer and the array of values of the variable parameters; never null. |
static boolean |
createNewByGA(ScorerCacheIF cache,
ScorerPopulation population,
SimpleLoggerIF log)
Create a new Scorer (parameter set) from existing ones using normal GA techniques. |
static boolean |
createNewByOpt(SimpleExhibitPipelineIF dataSource,
ScorerCacheIF cache,
ScorerPopulation population,
java.util.Map<Name.ExhibitShort,ScoreAndConf> calibSubset,
SimpleLoggerIF log,
long endTime)
Create a new Scorer (parameter set) from existing ones using a multi-variable "minimiser". |
private static java.util.List<java.lang.String> |
pickBreedingSet(ScorerCacheIF cache,
ScorerPopulation population,
boolean allowStale)
Select at random a best-first breeding set of one Scorer base type; null if none available. |
static boolean |
retrieveOldScorer(SimpleExhibitPipelineIF dataSource,
ScorerCacheIF cache,
ScorerPopulation population,
SimpleLoggerIF log)
This method attempts to retrieve a "new" Scorer from the persisted history. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SSOURCE_REC
public static final java.lang.String SSOURCE_GA
public static final java.lang.String SSOURCE_MIN
private static final boolean PERF_SAMPLE_CW
This should give a reasonable view of the most compute-intensive Scorer workload.
private static final java.util.concurrent.ConcurrentHashMap<java.lang.StackTraceElement,java.util.concurrent.atomic.AtomicInteger> perfCountsCW
public static final int MIN_SUGGESTED_CALIB_SET_SIZE
This should be large enough that no one Scorer has enough parameters to trivially map each different calibration exhibit to its correct score.
In general, while using a larger calibration sample set increases CPU and memory costs, especially for remote 'AH' clients that may need to fetch data, a larger calibration set should increase the reliability of calibrated results. But there may be a huge advantage in using a set small enough to keep in cache close to the top of the memory hierarchy.
We may want to try different calibration set sizes larger than the minimum to improve the usefulness and predictive power of the calibration set.
A power of two may allow for generation of slightly better code in various places.
Experience suggests that this value should be at least 128.
public static final int SUGGESTED_CALIB_SET_SIZE
Needs to be at least as large as the minimum 'voted-for' set to give good confidence.
A power of two may allow for generation of slightly better code.
public static final java.lang.String scorerTunnelRRURL
public static final java.lang.String DT_PARAM_NAME
public static final java.lang.String DT_CALIB
public static final java.lang.String DT_BESTSC
public static final java.lang.String DT_POSTNEWSC
public static final java.lang.String DT__GEN_DATA
| Constructor Detail |
|---|
public ScorerCreator()
| Method Detail |
|---|
public static boolean retrieveOldScorer(SimpleExhibitPipelineIF dataSource,
ScorerCacheIF cache,
ScorerPopulation population,
SimpleLoggerIF log)
throws java.io.IOException
java.io.IOException
public static boolean createNewByGA(ScorerCacheIF cache,
ScorerPopulation population,
SimpleLoggerIF log)
throws java.io.IOException
population - the extant population; never null
java.io.IOException
private static ScorerIF constructModifiedSNP(double[] par,
ScorerIF initialScorer,
java.util.List<ScorerParam> paramDefsAndValuesOriginal,
int[] mnIndexToParamIndex)
public static boolean createNewByOpt(SimpleExhibitPipelineIF dataSource,
ScorerCacheIF cache,
ScorerPopulation population,
java.util.Map<Name.ExhibitShort,ScoreAndConf> calibSubset,
SimpleLoggerIF log,
long endTime)
throws java.io.IOException
For the moment this only attempts to adjust the continuously-variable properties (ie the integer parameter values) and leaves the enumeration parameters alone.
population - the extant population; never nullcalibSubset - if non-null, should be non-empty and is a calibration set
to optimise/minimise againstendTime - target end time to stop computations at
java.io.IOException
private static java.util.List<java.lang.String> pickBreedingSet(ScorerCacheIF cache,
ScorerPopulation population,
boolean allowStale)
We weight this more heavily towards breeding sets whose best constituent has a high "goodness".
population - the extant population; never null
public static Tuple.Pair<ScoreAndConf,java.lang.Boolean> computeWeighting(java.util.Map<Name.ExhibitShort,ScoreAndConf> calibrationData,
ScorerCacheIF scorerCache,
ScorerIF scorer,
AllExhibitImmutableData aeid,
boolean allowStale)
throws java.io.IOException
calibrationData - map from short exhibit names to external calibration data
(eg actual user vote-based score); never null
java.io.IOException
public static ScoreAndConf computeWeighting(java.util.Map<Name.ExhibitShort,ScoreAndConf> scorerResult,
java.util.Map<Name.ExhibitShort,ScoreAndConf> calibrationData)
All keys in the calibration data should map to non-null values in the ratings map (ie the ratings keys can be a superset of the calibration keys); missing values will diminish the confidence of the result.
The input data must not change while this routine is running.
scorerResult - map from short exhibit name to Scorer's rating/result for the exhibit;
never nullcalibrationData - map from short exhibit name to external calibration data
(eg actual user vote-based score); never null
|
DHD Multimedia Gallery V1.53.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||