zonopy.batchMatPolyZonotope#
- class zonopy.batchMatPolyZonotope(Z, n_dep_gens=0, expMat=None, id=None, copy_Z=True, dtype=None, device=None)[source]#
Bases:
object
Batched 2D Matrix Polynomial Zonotopes
Batched form of the
matPolyZonotope
class. This class is designed to represent a batch of 2D matrix polynomial zonotopes over the same domain with arbitrary batch dimensions, extending the concept of polynomial zonotopes to matrix forms and allowing for batch processing. It adheres to a formulation similar to thepolyZonotope
andbatchPolyZonotope
classes, enabling efficient representation and manipulation of sets of matrix polynomial zonotopes.This results in a tensor, where and are the dimensions of the matrices.
Refer to the
matPolyZonotope
class for more detailed information on matrix polynomial zonotopes.- __init__(Z, n_dep_gens=0, expMat=None, id=None, copy_Z=True, dtype=None, device=None)[source]#
Constructor for the batchMatPolyZonotope class
Initializes a batch of 2D matrix polynomial zonotopes with specified characteristics.
- Parameters:
Z (torch.Tensor) – The center and generator tensor for the batch of matrix polynomial zonotopes. The shape of Z should be , where are the batch dimensions, is the number of dependent generators, is the number of independent generators, and are the dimensions of the matrices.
n_dep_gens (int, optional) – The number of dependent generators in the matrix polynomial zonotope. Default: 0.
expMat (torch.Tensor, optional) – The exponent matrix for the dependent generators. If None, it will be assumed to be the identity matrix. Default: None.
id (torch.Tensor, optional) – The integer identifiers for the dependent generators. If None, it will be the range of the number of dependent generators. Default: None.
copy_Z (bool, optional) – If True, a copy of the input Z tensor will be made. Default: True.
dtype (torch.dtype, optional) – The data type for the elements of the matrix polynomial zonotope. If None, it will be inferred from Z. Default: None.
device (torch.device, optional) – The device on which the matrix polynomial zonotope is to be stored. If None, it will be inferred from Z. Default: None.
- Raises:
AssertionError – If the dimension of the Z input is not 5 or more, indicating incorrect batch dimensions or matrix dimensions.
AssertionError – If the exponent matrix does not seem to be valid for the given number of dependent generators or ids.
AssertionError – If the number of dependent generators does not match the number of ids provided.
AssertionError – If the exponent matrix is not a non-negative integer matrix.
Methods
__init__
(Z[, n_dep_gens, expMat, id, ...])Constructor for the batchMatPolyZonotope class
combine_bmpz
(bmpzlist, idxs)compress
(compression_level)cpu
()eye
(batch_size, dim[, dtype, device])from_mpzlist
(mpzlist)ones
(batch_size, dim1[, dim2, dtype, device])reduce_indep
(order[, option])to
([dtype, itype, device])zeros
(batch_size, dim1[, dim2, dtype, device])Attributes
- property C#
- property G#
- property Grest#
- property T#
- property batch_shape#
- property device#
- property dtype#
- property input_pairs#
- property itype#
- property n_cols#
- property n_generators#
- property n_indep_gens#
- property n_rows#
- property shape#