Hierarchical Partition

The API references for the hierarchical partition of the parameter space. Please see the general partition class in API Cheatsheet.

Binary Partition

class PyXAB.partition.BinaryPartition.BinaryPartition(domain=None, node=<class 'PyXAB.partition.Node.P_node'>)

Bases: PyXAB.partition.Partition.Partition

Implementation of Binary Partition

__init__(domain=None, node=<class 'PyXAB.partition.Node.P_node'>)

Initialization of the Binary Partition

Parameters
  • domain (list(list)) – The domain of the objective function to be optimized, should be in the form of list of lists (hypercubes), i.e., [[range1], [range2], … [range_d]], where [range_i] is a list indicating the domain’s projection on the i-th dimension, e.g., [-1, 1]

  • node – The node used in the partition, with the default choice to be P_node.

deepen()

The function to deepen the partition by one layer by making children to every node in the last layer

get_depth()

The function to get the depth of the partition

Returns

depth – The depth of the partition

Return type

int

get_layer_node_list(depth)

The function to get the all the nodes on the specified depth

Parameters

depth (int) – The depth of the layer in the partition

Returns

self.node_list – The list of nodes on the specified depth

Return type

list

get_node_list()

The function to get the list all nodes in the partition

Returns

self.node_list – The list of all nodes

Return type

list

get_root()

The function to get the root of the partition

Returns

The root node of the partition

Return type

self.root

make_children(parent, newlayer=False)

The function to make children for the parent node with a standard binary partition, i.e., split every parent node in the middle. If there are multiple dimensions, the dimension to split the parent is chosen randomly

Parameters
  • parent – The parent node to be expanded into children nodes

  • newlayer (bool) – Boolean variable that indicates whether or not a new layer is created


Random Binary Partition

class PyXAB.partition.RandomBinaryPartition.RandomBinaryPartition(domain=None, node=<class 'PyXAB.partition.Node.P_node'>)

Bases: PyXAB.partition.Partition.Partition

Implementation of Random Binary Partition

__init__(domain=None, node=<class 'PyXAB.partition.Node.P_node'>)

Initialization of the Random Binary Partition

Parameters
  • domain (list(list)) – The domain of the objective function to be optimized, should be in the form of list of lists (hypercubes), i.e., [[range1], [range2], … [range_d]], where [range_i] is a list indicating the domain’s projection on the i-th dimension, e.g., [-1, 1]

  • node – The node used in the partition, with the default choice to be P_node.

deepen()

The function to deepen the partition by one layer by making children to every node in the last layer

get_depth()

The function to get the depth of the partition

Returns

depth – The depth of the partition

Return type

int

get_layer_node_list(depth)

The function to get the all the nodes on the specified depth

Parameters

depth (int) – The depth of the layer in the partition

Returns

self.node_list – The list of nodes on the specified depth

Return type

list

get_node_list()

The function to get the list all nodes in the partition

Returns

self.node_list – The list of all nodes

Return type

list

get_root()

The function to get the root of the partition

Returns

The root node of the partition

Return type

self.root

make_children(parent, newlayer=False)

The function to make children for the parent node with a random binary partition, i.e., split every parent node randomly into two children. If there are multiple dimensions, the dimension to split the parent is chosen randomly

Parameters
  • parent – The parent node to be expanded into children nodes

  • newlayer (bool) – Boolean variable that indicates whether or not a new layer is created


Dimension-wise Binary Partition

class PyXAB.partition.DimensionBinaryPartition.DimensionBinaryPartition(domain=None, node=<class 'PyXAB.partition.Node.P_node'>)

Bases: PyXAB.partition.Partition.Partition

Implementation of Dimension-wise Binary Partition

__init__(domain=None, node=<class 'PyXAB.partition.Node.P_node'>)

Initialization of the Dimension-wise Binary Partition

Parameters
  • domain (list(list)) – The domain of the objective function to be optimized, should be in the form of list of lists (hypercubes), i.e., [[range1], [range2], … [range_d]], where [range_i] is a list indicating the domain’s projection on the i-th dimension, e.g., [-1, 1]

  • node – The node used in the partition, with the default choice to be P_node.

deepen()

The function to deepen the partition by one layer by making children to every node in the last layer

get_depth()

The function to get the depth of the partition

Returns

depth – The depth of the partition

Return type

int

get_layer_node_list(depth)

The function to get the all the nodes on the specified depth

Parameters

depth (int) – The depth of the layer in the partition

Returns

self.node_list – The list of nodes on the specified depth

Return type

list

get_node_list()

The function to get the list all nodes in the partition

Returns

self.node_list – The list of all nodes

Return type

list

get_root()

The function to get the root of the partition

Returns

The root node of the partition

Return type

self.root

make_children(parent, newlayer=False)

The function to make children for the parent node with a dimension-wise binary partition, i.e., split every parent node into 2^d children where d is the dimension of the parameter domain. Each dimension of the domain is split right in the middle.

Parameters
  • parent – The parent node to be expanded into children nodes

  • newlayer (bool) – Boolean variable that indicates whether or not a new layer is created


Kary Partition

class PyXAB.partition.KaryPartition.KaryPartition(domain=None, K=3, node=<class 'PyXAB.partition.Node.P_node'>)

Bases: PyXAB.partition.Partition.Partition

Implementation of K-ary Partition especially when K >= 3, i.e., Ternary, Quaternary, and so on

__init__(domain=None, K=3, node=<class 'PyXAB.partition.Node.P_node'>)

Initialization of the K-ary Partition

Parameters
  • domain (list(list)) – The domain of the objective function to be optimized, should be in the form of list of lists (hypercubes), i.e., [[range1], [range2], … [range_d]], where [range_i] is a list indicating the domain’s projection on the i-th dimension, e.g., [-1, 1]

  • K (int) – The number of children of each parent, with the default choice to be 3

  • node – The node used in the partition, with the default choice to be P_node.

deepen()

The function to deepen the partition by one layer by making children to every node in the last layer

get_depth()

The function to get the depth of the partition

Returns

depth – The depth of the partition

Return type

int

get_layer_node_list(depth)

The function to get the all the nodes on the specified depth

Parameters

depth (int) – The depth of the layer in the partition

Returns

self.node_list – The list of nodes on the specified depth

Return type

list

get_node_list()

The function to get the list all nodes in the partition

Returns

self.node_list – The list of all nodes

Return type

list

get_root()

The function to get the root of the partition

Returns

The root node of the partition

Return type

self.root

make_children(parent, newlayer=False)

The function to make children for the parent node with a standard K-ary partition, i.e., split every parent node into K children nodes of the same size. If there are multiple dimensions, the dimension to split the parent is chosen randomly

Parameters
  • parent – The parent node to be expanded into children nodes

  • newlayer (bool) – Boolean variable that indicates whether or not a new layer is created


RandomKary Partition

class PyXAB.partition.RandomKaryPartition.RandomKaryPartition(domain=None, K=3, node=<class 'PyXAB.partition.Node.P_node'>)

Bases: PyXAB.partition.Partition.Partition

Implementation of Random K-ary Partition especially when K >= 3, i.e., Ternary, Quaternary, and so on

__init__(domain=None, K=3, node=<class 'PyXAB.partition.Node.P_node'>)

Initialization of the Random K-ary Partition

Parameters
  • domain (list(list)) – The domain of the objective function to be optimized, should be in the form of list of lists (hypercubes), i.e., [[range1], [range2], … [range_d]], where [range_i] is a list indicating the domain’s projection on the i-th dimension, e.g., [-1, 1]

  • K (int) – The number of children of each parent

  • node – The node used in the partition, with the default choice to be P_node.

deepen()

The function to deepen the partition by one layer by making children to every node in the last layer

get_depth()

The function to get the depth of the partition

Returns

depth – The depth of the partition

Return type

int

get_layer_node_list(depth)

The function to get the all the nodes on the specified depth

Parameters

depth (int) – The depth of the layer in the partition

Returns

self.node_list – The list of nodes on the specified depth

Return type

list

get_node_list()

The function to get the list all nodes in the partition

Returns

self.node_list – The list of all nodes

Return type

list

get_root()

The function to get the root of the partition

Returns

The root node of the partition

Return type

self.root

make_children(parent, newlayer=False)

The function to make children for the parent node with a random K-ary partition, i.e., split every parent node into K children nodes of different sizes. If there are multiple dimensions, the dimension to split the parent is chosen randomly

Parameters
  • parent – The parent node to be expanded into children nodes

  • newlayer (bool) – Boolean variable that indicates whether or not a new layer is created