Skip to content
Karel Kubicek edited this page Mar 12, 2017 · 6 revisions

Evaluators are modules for fitness computation based on circuit outputs.

Evaluators are identified by their evaluator type which is used in EACirc configuration file. Every evaluator is build in evaluator_factory and inherited from evaluator abstract class. Evaluators should be deterministic and depend solely on provided test vectors and circuit outputs. Design of evaluators needs statistical background, to avoid typical pitfalls, read EACirc 2 paper.

Currently implemented evaluators

Evaluator is selected in config file by subtree evaluator. The type is either weight-evaluator or categories-evaluator. An example:

"evaluator" : {
    "type" : "categories-evaluator",
    "num-of-categories" : 8
}

The field num-of-categories is applicable for both and specifies number of bits of circuit's output taken as an input for evaluation. Common value is 8, as EACirc outputs 1 byte.

Categories evaluator

Test vectors are considered as coming from 2 stream, differentiated by top bit of the expected output byte. Circuit output bytes are mapped into categories (value modulo number of categories), each byte is considered separately. For each stream there is a separate category map. Fitness is based on weighed Euclidean distance of corresponding categories.

Weight evaluator

Test vectors are considered as coming from 2 stream, differentiated by all bits of the expected output byte. Circuit outputs are interpreted by looking at all bits of each byte separately. Fitness is computed as an average per every bit of the ratio of correctly predicted test vectors and all test vectors.

Binary value normalise specifies, is the fitness will be p-value of measured data (true), or non-normalised ratio of true_guesses/total_guesses (false).

Evaluators interface

Evaluator has simple interface and it has no internal state.

  • void change_datasets(dataset const& a, dataset const& b)
    Updates input to the dataset.
  • double apply(Circuit const& circuit)
    Return the circuit's fitness value based on the evaluation of datasets a and b in circuit circuit.
Clone this wiki locally