-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
483 additions
and
591 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,9 @@ | ||
""" Torch Extensions for PhotonTorch | ||
Since PhotonTorch is a photonic simulation framework in the first place, | ||
we require some extra functionalities that PyTorch does not offer out of | ||
the box. | ||
Below you can find a short summary: | ||
* ``block_diag``: a differentiable implementation of a block diagonal matrix | ||
performed over a batch of matrices. | ||
* ``BoundedParameter``: A bounded parameter is a special kind of | ||
``torch.nn.Parameter`` that is bounded between a certain range. | ||
* ``Buffer``: A special kind of tensor that automatically will | ||
be added to the ``._buffers`` attribute of the Module. Buffers are typically | ||
used as parameters of the model that do not require gradients. | ||
* ``Module``: Extends ``torch.nn.Module``, with some extra | ||
features, such as automatically registering a ``Buffer`` in its | ||
``._buffers`` attribute, modified ``.cuda()`` calls and some extra | ||
functionalities. | ||
* ``BitStreamGenerator``: A simple class that generates random bitstreams. | ||
* ``BERLoss``: A Module that calculates the bit error rate between two bitstreams. | ||
* ``MSELoss``: A Module that calculates the mean squared error between two bitstreams. | ||
""" | ||
|
||
|
||
## custom torch differentiable functions | ||
from .autograd import block_diag | ||
|
||
|
||
## custom neural network functions [not imported] | ||
# nn.nn | ||
""" neural network (nn) extensions """ | ||
|
||
# custom functional additions | ||
from .functional import BERLoss | ||
from .functional import MSELoss | ||
from .functional import BitStreamGenerator | ||
from .nn import Module | ||
from .nn import Buffer | ||
from .nn import BERLoss | ||
from .nn import MSELoss | ||
from .nn import BoundedParameter | ||
from .nn import BitStreamGenerator |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.