-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: improve performance of model & forward layer (#616)
Closes #610 ### Summary of Changes Fixed some bugs and improved the performance of some methods, there are still some changes to be made but it is helpful to merge this now as @Marsmaennchen221 and @Gerhardsa0 partly depend on it --------- Co-authored-by: Alexander Gréus <[email protected]> Co-authored-by: megalinter-bot <[email protected]> Co-authored-by: Alexander <[email protected]> Co-authored-by: WinPlay02 <[email protected]>
- Loading branch information
1 parent
1ed2d56
commit e856cd5
Showing
11 changed files
with
327 additions
and
129 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
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,10 +1,10 @@ | ||
"""Classes for classification tasks.""" | ||
|
||
from ._fnn_layer import FNNLayer | ||
from ._forward_layer import ForwardLayer | ||
from ._model import NeuralNetworkClassifier, NeuralNetworkRegressor | ||
|
||
__all__ = [ | ||
"FNNLayer", | ||
"ForwardLayer", | ||
"NeuralNetworkClassifier", | ||
"NeuralNetworkRegressor", | ||
] |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from abc import ABC, abstractmethod | ||
|
||
from torch import nn | ||
|
||
|
||
class Layer(ABC): | ||
@abstractmethod | ||
def __init__(self) -> None: | ||
pass # pragma: no cover | ||
|
||
@abstractmethod | ||
def _get_internal_layer(self, activation_function: str) -> nn.Module: | ||
pass # pragma: no cover | ||
|
||
@property | ||
@abstractmethod | ||
def input_size(self) -> int: | ||
pass # pragma: no cover | ||
|
||
@property | ||
@abstractmethod | ||
def output_size(self) -> int: | ||
pass # pragma: no cover | ||
|
||
@abstractmethod | ||
def _set_input_size(self, input_size: int) -> None: | ||
pass # pragma: no cover |
Oops, something went wrong.