aepsych package¶
Subpackages¶
Submodules¶
aepsych.config module¶
- class aepsych.config.Config(config_dict=None, config_fnames=None, config_str=None)[source]¶
Bases:
ConfigParser
Initialize the AEPsych config object. This can be used to instantiate most objects in AEPsych by calling object.from_config(config).
- Parameters
config_dict (Mapping[str, str], optional) – Mapping to build configuration from. Keys are section names, values are dictionaries with keys and values that should be present in the section. Defaults to None.
config_fnames (Sequence[str], optional) – List of INI filenames to load configuration from. Defaults to None.
config_str (str, optional) – String formatted as an INI file to load configuration from. Defaults to None.
- registered_names: ClassVar[Dict[str, object]] = {'AcquisitionFunction': <class 'botorch.acquisition.acquisition.AcquisitionFunction'>, 'AdditiveKernel': <class 'gpytorch.kernels.kernel.AdditiveKernel'>, 'AdditiveStructureKernel': <class 'gpytorch.kernels.additive_structure_kernel.AdditiveStructureKernel'>, 'AnalyticAcquisitionFunction': <class 'botorch.acquisition.analytic.AnalyticAcquisitionFunction'>, 'AnalyticExpectedUtilityOfBestOption': <class 'botorch.acquisition.preference.AnalyticExpectedUtilityOfBestOption'>, 'ApproxGlobalSUR': <class 'aepsych.acquisition.lookahead.ApproxGlobalSUR'>, 'ArcKernel': <class 'gpytorch.kernels.arc_kernel.ArcKernel'>, 'BernoulliMCMutualInformation': <class 'aepsych.acquisition.mutual_information.BernoulliMCMutualInformation'>, 'ConstrainedExpectedImprovement': <class 'botorch.acquisition.analytic.ConstrainedExpectedImprovement'>, 'ConstrainedMCObjective': <class 'botorch.acquisition.objective.ConstrainedMCObjective'>, 'CosineKernel': <class 'gpytorch.kernels.cosine_kernel.CosineKernel'>, 'CylindricalKernel': <class 'gpytorch.kernels.cylindrical_kernel.CylindricalKernel'>, 'DistributionalInputKernel': <class 'gpytorch.kernels.distributional_input_kernel.DistributionalInputKernel'>, 'EAVC': <class 'aepsych.acquisition.lookahead.EAVC'>, 'ExpectedImprovement': <class 'botorch.acquisition.analytic.ExpectedImprovement'>, 'FixedFeatureAcquisitionFunction': <class 'botorch.acquisition.fixed_feature.FixedFeatureAcquisitionFunction'>, 'FloorGumbelObjective': <class 'aepsych.acquisition.objective.FloorGumbelObjective'>, 'FloorLogitObjective': <class 'aepsych.acquisition.objective.FloorLogitObjective'>, 'FloorProbitObjective': <class 'aepsych.acquisition.objective.FloorProbitObjective'>, 'GaussianSymmetrizedKLKernel': <class 'gpytorch.kernels.gaussian_symmetrized_kl_kernel.GaussianSymmetrizedKLKernel'>, 'GenericCostAwareUtility': <class 'botorch.acquisition.cost_aware.GenericCostAwareUtility'>, 'GenericMCObjective': <class 'botorch.acquisition.objective.GenericMCObjective'>, 'GlobalMI': <class 'aepsych.acquisition.lookahead.GlobalMI'>, 'GlobalSUR': <class 'aepsych.acquisition.lookahead.GlobalSUR'>, 'GridInterpolationKernel': <class 'gpytorch.kernels.grid_interpolation_kernel.GridInterpolationKernel'>, 'GridKernel': <class 'gpytorch.kernels.grid_kernel.GridKernel'>, 'IdentityMCObjective': <class 'botorch.acquisition.objective.IdentityMCObjective'>, 'IndexKernel': <class 'gpytorch.kernels.index_kernel.IndexKernel'>, 'InducingPointKernel': <class 'gpytorch.kernels.inducing_point_kernel.InducingPointKernel'>, 'InverseCostWeightedUtility': <class 'botorch.acquisition.cost_aware.InverseCostWeightedUtility'>, 'Kernel': <class 'gpytorch.kernels.kernel.Kernel'>, 'LCMKernel': <class 'gpytorch.kernels.lcm_kernel.LCMKernel'>, 'LearnedObjective': <class 'botorch.acquisition.objective.LearnedObjective'>, 'LinearKernel': <class 'gpytorch.kernels.linear_kernel.LinearKernel'>, 'LinearMCObjective': <class 'botorch.acquisition.objective.LinearMCObjective'>, 'LocalMI': <class 'aepsych.acquisition.lookahead.LocalMI'>, 'LocalSUR': <class 'aepsych.acquisition.lookahead.LocalSUR'>, 'MCAcquisitionFunction': <class 'botorch.acquisition.monte_carlo.MCAcquisitionFunction'>, 'MCAcquisitionObjective': <class 'botorch.acquisition.objective.MCAcquisitionObjective'>, 'MCLevelSetEstimation': <class 'aepsych.acquisition.lse.MCLevelSetEstimation'>, 'MCPosteriorVariance': <class 'aepsych.acquisition.mc_posterior_variance.MCPosteriorVariance'>, 'MaternKernel': <class 'gpytorch.kernels.matern_kernel.MaternKernel'>, 'MaxValueBase': <class 'botorch.acquisition.max_value_entropy_search.MaxValueBase'>, 'MonotonicBernoulliMCMutualInformation': <class 'aepsych.acquisition.mutual_information.MonotonicBernoulliMCMutualInformation'>, 'MonotonicMCLSE': <class 'aepsych.acquisition.monotonic_rejection.MonotonicMCLSE'>, 'MonotonicMCPosteriorVariance': <class 'aepsych.acquisition.mc_posterior_variance.MonotonicMCPosteriorVariance'>, 'MultiDeviceKernel': <class 'gpytorch.kernels.multi_device_kernel.MultiDeviceKernel'>, 'MultitaskKernel': <class 'gpytorch.kernels.multitask_kernel.MultitaskKernel'>, 'NewtonGirardAdditiveKernel': <class 'gpytorch.kernels.newton_girard_additive_kernel.NewtonGirardAdditiveKernel'>, 'NoisyExpectedImprovement': <class 'botorch.acquisition.analytic.NoisyExpectedImprovement'>, 'None': None, 'OneShotAcquisitionFunction': <class 'botorch.acquisition.acquisition.OneShotAcquisitionFunction'>, 'PairwiseMCPosteriorVariance': <class 'botorch.acquisition.active_learning.PairwiseMCPosteriorVariance'>, 'PeriodicKernel': <class 'gpytorch.kernels.periodic_kernel.PeriodicKernel'>, 'PiecewisePolynomialKernel': <class 'gpytorch.kernels.piecewise_polynomial_kernel.PiecewisePolynomialKernel'>, 'PolynomialKernel': <class 'gpytorch.kernels.polynomial_kernel.PolynomialKernel'>, 'PolynomialKernelGrad': <class 'gpytorch.kernels.polynomial_kernel_grad.PolynomialKernelGrad'>, 'PosteriorMean': <class 'botorch.acquisition.analytic.PosteriorMean'>, 'ProbabilityOfImprovement': <class 'botorch.acquisition.analytic.ProbabilityOfImprovement'>, 'ProbitObjective': <class 'aepsych.acquisition.objective.ProbitObjective'>, 'ProductKernel': <class 'gpytorch.kernels.kernel.ProductKernel'>, 'ProductStructureKernel': <class 'gpytorch.kernels.product_structure_kernel.ProductStructureKernel'>, 'ProximalAcquisitionFunction': <class 'botorch.acquisition.proximal.ProximalAcquisitionFunction'>, 'RBFKernel': <class 'gpytorch.kernels.rbf_kernel.RBFKernel'>, 'RBFKernelGrad': <class 'gpytorch.kernels.rbf_kernel_grad.RBFKernelGrad'>, 'RFFKernel': <class 'gpytorch.kernels.rff_kernel.RFFKernel'>, 'RQKernel': <class 'gpytorch.kernels.rq_kernel.RQKernel'>, 'ScalarizedObjective': <class 'botorch.acquisition.objective.ScalarizedObjective'>, 'ScalarizedPosteriorTransform': <class 'botorch.acquisition.objective.ScalarizedPosteriorTransform'>, 'ScaleKernel': <class 'gpytorch.kernels.scale_kernel.ScaleKernel'>, 'SpectralDeltaKernel': <class 'gpytorch.kernels.spectral_delta_kernel.SpectralDeltaKernel'>, 'SpectralMixtureKernel': <class 'gpytorch.kernels.spectral_mixture_kernel.SpectralMixtureKernel'>, 'UpperConfidenceBound': <class 'botorch.acquisition.analytic.UpperConfidenceBound'>, 'default_mean_covar_factory': <function default_mean_covar_factory>, 'get_acqf_input_constructor': <function get_acqf_input_constructor>, 'get_acquisition_function': <function get_acquisition_function>, 'monotonic_mean_covar_factory': <function monotonic_mean_covar_factory>, 'ordinal_mean_covar_factory': <function ordinal_mean_covar_factory>, 'qExpectedImprovement': <class 'botorch.acquisition.monte_carlo.qExpectedImprovement'>, 'qKnowledgeGradient': <class 'botorch.acquisition.knowledge_gradient.qKnowledgeGradient'>, 'qLowerBoundMaxValueEntropy': <class 'botorch.acquisition.max_value_entropy_search.qLowerBoundMaxValueEntropy'>, 'qMaxValueEntropy': <class 'botorch.acquisition.max_value_entropy_search.qMaxValueEntropy'>, 'qMultiFidelityKnowledgeGradient': <class 'botorch.acquisition.knowledge_gradient.qMultiFidelityKnowledgeGradient'>, 'qMultiFidelityLowerBoundMaxValueEntropy': <class 'botorch.acquisition.max_value_entropy_search.qMultiFidelityLowerBoundMaxValueEntropy'>, 'qMultiFidelityMaxValueEntropy': <class 'botorch.acquisition.max_value_entropy_search.qMultiFidelityMaxValueEntropy'>, 'qMultiStepLookahead': <class 'botorch.acquisition.multi_step_lookahead.qMultiStepLookahead'>, 'qNegIntegratedPosteriorVariance': <class 'botorch.acquisition.active_learning.qNegIntegratedPosteriorVariance'>, 'qNoisyExpectedImprovement': <class 'botorch.acquisition.monte_carlo.qNoisyExpectedImprovement'>, 'qProbabilityOfImprovement': <class 'botorch.acquisition.monte_carlo.qProbabilityOfImprovement'>, 'qSimpleRegret': <class 'botorch.acquisition.monte_carlo.qSimpleRegret'>, 'qUpperConfidenceBound': <class 'botorch.acquisition.monte_carlo.qUpperConfidenceBound'>, 'song_mean_covar_factory': <function song_mean_covar_factory>}¶
- update(config_dict=None, config_fnames=None, config_str=None)[source]¶
Update this object with a new configuration.
- Parameters
config_dict (Mapping[str, str], optional) – Mapping to build configuration from. Keys are section names, values are dictionaries with keys and values that should be present in the section. Defaults to None.
config_fnames (Sequence[str], optional) – List of INI filenames to load configuration from. Defaults to None.
config_str (str, optional) – String formatted as an INI file to load configuration from. Defaults to None.
- classmethod register_module(module)[source]¶
- Register a module with Config so that objects in it can
be referred to by their string name in config files.
- Parameters
module (ModuleType) – Module to register.
- classmethod register_object(obj)[source]¶
- Register an object with Config so that it can be
referred to by its string name in config files.
- Parameters
obj (object) – Object to register.
- convert(from_version, to_version)[source]¶
Converts a config from an older version to a newer version.
- Parameters
from_version (str) – The version of the config to be converted.
to_version (str) – The version the config should be converted to.
- Return type
None
- property version: str¶
Returns the version number of the config.
aepsych.likelihoods module¶
aepsych.plotting module¶
aepsych.strategy module¶
aepsych.utils module¶
- aepsych.utils.dim_grid(lower, upper, dim, gridsize=30, slice_dims=None)[source]¶
Create a grid Create a grid based on lower, upper, and dim. :param - lower (‘int’) - lower bound: :param - upper (‘int’) - upper bound: :param - dim (‘int) - dimension: :param - gridsize (‘int’) - size for grid: :param - slice_dims (Optional: :type - slice_dims (Optional: value} dict :param dict) - values to use for slicing axes: :type dict) - values to use for slicing axes: value} dict :param as an {index: :type as an {index: value} dict
- Returns
grid – Tensor
- Return type
torch.FloatTensor
- Parameters
lower (Tensor) –
upper (Tensor) –
dim (int) –
gridsize (int) –
slice_dims (Optional[Mapping[int, float]]) –