-
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.
feat: move NN converters and layers to separate packages (#759)
### Summary of Changes NN converters and layers are now in separate packages. We can later re-export them from the `safeds.ml.nn` package based on user feedback.
- Loading branch information
1 parent
9e40b65
commit c6a4073
Showing
35 changed files
with
237 additions
and
175 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,21 @@ | ||
"""Classes for classification tasks.""" | ||
"""Neural networks for various tasks.""" | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
import apipkg | ||
|
||
if TYPE_CHECKING: | ||
from ._convolutional2d_layer import Convolutional2DLayer, ConvolutionalTranspose2DLayer | ||
from ._flatten_layer import FlattenLayer | ||
from ._forward_layer import ForwardLayer | ||
from ._input_conversion import InputConversion | ||
from ._input_conversion_image import InputConversionImage | ||
from ._input_conversion_table import InputConversionTable | ||
from ._input_conversion_time_series import InputConversionTimeSeries | ||
from ._layer import Layer | ||
from ._lstm_layer import LSTMLayer | ||
from ._model import NeuralNetworkClassifier, NeuralNetworkRegressor | ||
from ._output_conversion import OutputConversion | ||
from ._output_conversion_image import ( | ||
OutputConversionImageToColumn, | ||
OutputConversionImageToImage, | ||
OutputConversionImageToTable, | ||
) | ||
from ._output_conversion_table import OutputConversionTable | ||
from ._output_conversion_time_series import OutputConversionTimeSeries | ||
from ._pooling2d_layer import AvgPooling2DLayer, MaxPooling2DLayer | ||
|
||
apipkg.initpkg( | ||
__name__, | ||
{ | ||
"AvgPooling2DLayer": "._pooling2d_layer:AvgPooling2DLayer", | ||
"Convolutional2DLayer": "._convolutional2d_layer:Convolutional2DLayer", | ||
"ConvolutionalTranspose2DLayer": "._convolutional2d_layer:ConvolutionalTranspose2DLayer", | ||
"FlattenLayer": "._flatten_layer:FlattenLayer", | ||
"ForwardLayer": "._forward_layer:ForwardLayer", | ||
"InputConversion": "._input_conversion:InputConversion", | ||
"InputConversionImage": "._input_conversion_image:InputConversionImage", | ||
"InputConversionTable": "._input_conversion_table:InputConversionTable", | ||
"Layer": "._layer:Layer", | ||
"OutputConversion": "._output_conversion:OutputConversion", | ||
"InputConversionTimeSeries": "._input_conversion_time_series:InputConversionTimeSeries", | ||
"LSTMLayer": "._lstm_layer:LSTMLayer", | ||
"OutputConversionTable": "._output_conversion_table:OutputConversionTable", | ||
"OutputConversionTimeSeries": "._output_conversion_time_series:OutputConversionTimeSeries", | ||
"MaxPooling2DLayer": "._pooling2d_layer:MaxPooling2DLayer", | ||
"NeuralNetworkClassifier": "._model:NeuralNetworkClassifier", | ||
"NeuralNetworkRegressor": "._model:NeuralNetworkRegressor", | ||
"OutputConversionImageToColumn": "._output_conversion_image:OutputConversionImageToColumn", | ||
"OutputConversionImageToImage": "._output_conversion_image:OutputConversionImageToImage", | ||
"OutputConversionImageToTable": "._output_conversion_image:OutputConversionImageToTable", | ||
}, | ||
) | ||
|
||
__all__ = [ | ||
"AvgPooling2DLayer", | ||
"Convolutional2DLayer", | ||
"ConvolutionalTranspose2DLayer", | ||
"FlattenLayer", | ||
"ForwardLayer", | ||
"InputConversion", | ||
"InputConversionImage", | ||
"InputConversionTable", | ||
"Layer", | ||
"MaxPooling2DLayer", | ||
"OutputConversion", | ||
"InputConversionTimeSeries", | ||
"LSTMLayer", | ||
"OutputConversionTable", | ||
"OutputConversionTimeSeries", | ||
"NeuralNetworkClassifier", | ||
"NeuralNetworkRegressor", | ||
"OutputConversionImageToColumn", | ||
"OutputConversionImageToImage", | ||
"OutputConversionImageToTable", | ||
] |
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,48 @@ | ||
"""Converters between our data contains and tensors.""" | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
import apipkg | ||
|
||
if TYPE_CHECKING: | ||
from ._input_conversion import InputConversion | ||
from ._input_conversion_image import InputConversionImage | ||
from ._input_conversion_table import InputConversionTable | ||
from ._input_conversion_time_series import InputConversionTimeSeries | ||
from ._output_conversion import OutputConversion | ||
from ._output_conversion_image import ( | ||
OutputConversionImageToColumn, | ||
OutputConversionImageToImage, | ||
OutputConversionImageToTable, | ||
) | ||
from ._output_conversion_table import OutputConversionTable | ||
from ._output_conversion_time_series import OutputConversionTimeSeries | ||
|
||
apipkg.initpkg( | ||
__name__, | ||
{ | ||
"InputConversion": "._input_conversion:InputConversion", | ||
"InputConversionImage": "._input_conversion_image:InputConversionImage", | ||
"InputConversionTable": "._input_conversion_table:InputConversionTable", | ||
"InputConversionTimeSeries": "._input_conversion_time_series:InputConversionTimeSeries", | ||
"OutputConversion": "._output_conversion:OutputConversion", | ||
"OutputConversionImageToColumn": "._output_conversion_image:OutputConversionImageToColumn", | ||
"OutputConversionImageToImage": "._output_conversion_image:OutputConversionImageToImage", | ||
"OutputConversionImageToTable": "._output_conversion_image:OutputConversionImageToTable", | ||
"OutputConversionTable": "._output_conversion_table:OutputConversionTable", | ||
"OutputConversionTimeSeries": "._output_conversion_time_series:OutputConversionTimeSeries", | ||
}, | ||
) | ||
|
||
__all__ = [ | ||
"InputConversion", | ||
"InputConversionImage", | ||
"InputConversionTable", | ||
"InputConversionTimeSeries", | ||
"OutputConversion", | ||
"OutputConversionImageToColumn", | ||
"OutputConversionImageToImage", | ||
"OutputConversionImageToTable", | ||
"OutputConversionTable", | ||
"OutputConversionTimeSeries", | ||
] |
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
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"""Layers of neural networks.""" | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
import apipkg | ||
|
||
if TYPE_CHECKING: | ||
from ._convolutional2d_layer import Convolutional2DLayer, ConvolutionalTranspose2DLayer | ||
from ._flatten_layer import FlattenLayer | ||
from ._forward_layer import ForwardLayer | ||
from ._layer import Layer | ||
from ._lstm_layer import LSTMLayer | ||
from ._pooling2d_layer import AveragePooling2DLayer, MaxPooling2DLayer | ||
|
||
apipkg.initpkg( | ||
__name__, | ||
{ | ||
"Convolutional2DLayer": "._convolutional2d_layer:Convolutional2DLayer", | ||
"ConvolutionalTranspose2DLayer": "._convolutional2d_layer:ConvolutionalTranspose2DLayer", | ||
"FlattenLayer": "._flatten_layer:FlattenLayer", | ||
"ForwardLayer": "._forward_layer:ForwardLayer", | ||
"Layer": "._layer:Layer", | ||
"LSTMLayer": "._lstm_layer:LSTMLayer", | ||
"AveragePooling2DLayer": "._pooling2d_layer:AveragePooling2DLayer", | ||
"MaxPooling2DLayer": "._pooling2d_layer:MaxPooling2DLayer", | ||
}, | ||
) | ||
|
||
__all__ = [ | ||
"Convolutional2DLayer", | ||
"ConvolutionalTranspose2DLayer", | ||
"FlattenLayer", | ||
"ForwardLayer", | ||
"Layer", | ||
"LSTMLayer", | ||
"AveragePooling2DLayer", | ||
"MaxPooling2DLayer", | ||
] |
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
File renamed without changes.
Oops, something went wrong.