Born's Layer
Bases: 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 |
device
|
The device
on which |
None
|
dtype |
dtype
|
The data type
of |
None
|
Attributes:
Name | Type | Description |
---|---|---|
weight |
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 each input sample:
where is the modulus of complex numbers.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Tensor
|
Input samples of shape ( |
required |
Returns:
Name | Type | Description |
---|---|---|
y |
Tensor
|
Output probabilities of shape ( |