We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4280565 commit b4ea1a3Copy full SHA for b4ea1a3
neuralnetlib/layers.py
@@ -213,9 +213,10 @@ def from_config(config: dict):
213
214
215
class Activation(Layer):
216
- def __init__(self, activation_function: ActivationFunction):
+ def __init__(self, activation_function: ActivationFunction | str):
217
super().__init__()
218
- self.activation_function = activation_function
+ self.activation_function = activation_function if isinstance(
219
+ activation_function, ActivationFunction) else ActivationFunction.from_name(activation_function)
220
221
def __str__(self) -> str:
222
name = type(self.activation_function).__name__
0 commit comments