TensorContractionLayer¶
Full Name
neuroptimiser.core.processes.TensorContractionLayer
Description
- class TensorContractionLayer[source]¶
Bases:
AbstractProcess
Tensor Contraction Layer Process
This process implements a tensor contraction layer that takes a weight matrix and computes the output based on the input tensor. It is designed to be used in spiking neural network architectures where tensor contractions are required.
- Inports¶
- s_inInPort
Input port for the input tensor.
- Variables¶
- weight_matrixVar
Variable for the weight matrix used in the tensor contraction.
- s_matrixVar
Variable for the output tensor after the contraction.
- Outports¶
- a_outOutPort
Output port for the output tensor after the contraction.
See also
neuroptimiser.core.models.PyTensorContractionLayerModel
Model implementation of the TensorContractionLayer process.
- __init__(weights, **kwargs)[source]¶
Initialise the TensorContractionLayer with the given parameters.
- Parameters:
weights (np.ndarray) – Weight matrix for the tensor contraction. It should be a 2D numpy array.
- Keyword Arguments:
**kwargs (dict, optional) – Additional keyword arguments to be passed to the parent class AbstractProcess.