Born's Layer
Bases: torch.nn.Module
Pytorch implementation of Born's Layer
This class is compatible with pytorch. It supports real and complex-valued inputs. Outputs probabilities in the range .
Parameters:
Name | Type | Description | Default |
---|---|---|---|
in_features |
int
|
Size of each input sample. |
required |
out_features |
int
|
Size of each output sample. |
required |
device |
torch.device
|
The device
on which |
None
|
dtype |
torch.dtype
|
The data type
of |
None
|
Attributes:
Name | Type | Description |
---|---|---|
weight |
torch.Tensor
|
The learnable complex-valued weights of the module. The values are initialized from:
where is equal to |
Source code in bornrule/torch/born.py
forward(x)
Applies the following transformation to the incoming data:
where is the modulus of complex numbers, and is the L1-norm of a vector.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
torch.Tensor
|
Input samples of shape ( |
required |
Returns:
Name | Type | Description |
---|---|---|
y |
torch.Tensor
|
Output probabilities of shape ( |