Benchmarks

A Benchmark runs an experiment on a BrainModel and tests the resulting measurements against primate data. This comparison is done by a Metric which outputs a score of how well model and data match. This score is normalized with data ceilings and the benchmark returns this ceiled score.

class brainscore_vision.benchmarks.Benchmark[source]

Standard Benchmark interface defining the method interfaces.

__call__(candidate: BrainModel) Score[source]

Evaluate a candidate BrainModel and return a Score denoting the brain-likeness of the model under this benchmark. Typically this involves reproducing the experiment on the model and then comparing model measurements (e.g. neural/behavioral) against recordings from biological subjects (e.g. primates) using a Metric. The output of this method is a normalized score between 0 and 1 where 0 means the model does not match the measurements at all and 1 means the model matches the measurements at ceiling level (e.g. if the model obtains a score of 0.8 and the data ceiling is also 0.8, the score output by this method should be 1).

Parameters:

candidate – a candidate model implementing the BrainModel interface. Benchmarks are agnostic of the exact implementation and only interact with models through the methods defined in the interface.

Returns:

a Score of how brain-like the candidate model is under this benchmark. The score is normalized by this benchmark’s ceiling such that 1 means the model matches the data to ceiling level.

property bibtex: str

bibtex string to build the reference. Should include an url to build a proper link.

property ceiling: Score

The ceiling of this benchmark. Scores need to be normalized by this value. Typically this represents the signal in the data and how well we expect the best possible model to score.

Returns:

a Score object, denoting the ceiling of this benchmark. The Score values itself typically consist of just a scalar between zero and one. Many ceilers also include the error estimate and raw values, available in ceiling.attrs[‘error’] and ceiling.attrs[‘raw’] respectively.

property identifier: str

Unique identifier for this benchmark. Standard format is <data identifier>-<metric identifier>, e.g. Rajalingham2018-i2n.

Returns:

a unique identifier for this benchmark

property version: str

Optional, but strongly encouraged.

Returns:

a version number that is increased every time the model scores for this benchmark change (but not for code changes that do not change scores).

class brainscore_vision.benchmarks.BenchmarkBase(identifier, ceiling_func, version, parent=None, bibtex=None)[source]

Helper class for implementing standard functions of the Benchmark interface.

__init__(identifier, ceiling_func, version, parent=None, bibtex=None)[source]
property bibtex

bibtex string to build the reference. Should include an url to build a proper link.

property ceiling

The ceiling of this benchmark. Scores need to be normalized by this value. Typically this represents the signal in the data and how well we expect the best possible model to score.

Returns:

a Score object, denoting the ceiling of this benchmark. The Score values itself typically consist of just a scalar between zero and one. Many ceilers also include the error estimate and raw values, available in ceiling.attrs[‘error’] and ceiling.attrs[‘raw’] respectively.

property identifier

Unique identifier for this benchmark. Standard format is <data identifier>-<metric identifier>, e.g. Rajalingham2018-i2n.

Returns:

a unique identifier for this benchmark

property version

Optional, but strongly encouraged.

Returns:

a version number that is increased every time the model scores for this benchmark change (but not for code changes that do not change scores).

brainscore_vision.benchmarks.ceil_score(score: Score, ceiling: Score) Score[source]