bnelearn.experiment.experiment module

This module defines an experiment. It includes logging and plotting since they can often be shared by specific experiments.

class bnelearn.experiment.experiment.Experiment(config: ExperimentConfig)[source]

Bases: ABC

Abstract Class representing an experiment

action_size: int
bne_env: AuctionEnvironment
bne_utilities: Tensor
epoch: int
input_length: int
mechanism: Mechanism
n_models: int
observation_size: int
plot_xmax: float
plot_xmin: float
plot_ymax: float
plot_ymin: float
positive_output_point: Tensor
pretrain_transform(player_position: int) callable[source]

Some experiments need specific pretraining transformations. In most cases, pretraining to the truthful bid (i.e. the identity function) is sufficient.

Args:
player_position (:int:) the player for which the transformation is

requested.

Returns

(:callable:) pretraining transformation

run() bool[source]

Runs the experiment implemented by this class, i.e. all defined runs.

If a run fails for whatever reason, a warning will be raised and the next run will be triggered until all runs have completed/failed.

Returns:

success (bool): True if all runs ran successfully, false otherwise.

valuation_size: int