csle_agents.agents.bayesian_optimization_emukit.bo.kernel package

Submodules

csle_agents.agents.bayesian_optimization_emukit.bo.kernel.kernel_config module

class csle_agents.agents.bayesian_optimization_emukit.bo.kernel.kernel_config.KernelConfig[source]

Bases: abc.ABC

Abstract class representing a kernel configuration

abstract create_kernel(input_dim: int, var_function: Any) GPy.kern.src.kern.Kern[source]

Abstract method for creating the kernel (returning a GPy kernel) that each subclass should implement

Parameters
  • input_dim – the input dimension of the function of the GP

  • var_function – the variance function of the kernel

Returns

the GPY kernel

abstract static from_dict(d: Dict[str, Any]) csle_agents.agents.bayesian_optimization_emukit.bo.kernel.kernel_config.KernelConfig[source]

Converts a dict representation of the object to an instance

Parameters

d – the dict to convert

Returns

the converted instance

abstract static from_json_file(json_file_path: str) csle_agents.agents.bayesian_optimization_emukit.bo.kernel.kernel_config.KernelConfig[source]

Reads a json file and converts it to an object

Parameters

json_file_path – the json file path

Returns

the object

abstract to_dict() Dict[str, Any][source]

Converts the object to a dict representation

Returns

a dict representation of the object

to_json_file(json_file_path: str) None[source]

Saves the object to a json file

Parameters

json_file_path – the json file path to save the DTO to

Returns

None

to_json_str() str[source]

Converts the DTO into a json string

Returns

the json string representation of the DTO

csle_agents.agents.bayesian_optimization_emukit.bo.kernel.kernel_type module

class csle_agents.agents.bayesian_optimization_emukit.bo.kernel.kernel_type.KernelType(value)[source]

Bases: enum.IntEnum

Enum representing different kernels

RBF = 0

csle_agents.agents.bayesian_optimization_emukit.bo.kernel.rbf_kernel_config module

class csle_agents.agents.bayesian_optimization_emukit.bo.kernel.rbf_kernel_config.RBFKernelConfig(lengthscale_rbf_kernel: float = 1.0, variance_rbf_kernel: float = 1.0)[source]

Bases: csle_agents.agents.bayesian_optimization_emukit.bo.kernel.kernel_config.KernelConfig

DTO representing the configuration of the RBF Kernel, based on the implementation in GPy.

create_kernel(input_dim: int, var_function: Optional[Any] = None) GPy.kern.src.rbf.RBF[source]

Creates the GPy kernel

Parameters
  • input_dim – the dimension of the input of the function to model

  • var_function – the variance function of the kernel

Returns

the created GPy RBF kernel

static from_dict(d: Dict[str, Any]) csle_agents.agents.bayesian_optimization_emukit.bo.kernel.rbf_kernel_config.RBFKernelConfig[source]

Converts a dict representation to an instance

Parameters

d – the dict to convert

Returns

the created instance

static from_json_file(json_file_path: str) csle_agents.agents.bayesian_optimization_emukit.bo.kernel.rbf_kernel_config.RBFKernelConfig[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

to_dict() Dict[str, Any][source]

Gets a dict representation of the object

Returns

A dict representation of the object

Module contents