File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 44
55
66class LLAAF (torch .nn .Module ):
7+ """Pytorch implementation of layer-wise locally adaptive
8+ activation functions (L-LAAF).
9+
10+ Examples:
11+
12+ To define a L-LAAF ReLU with the scaling factor ``n = 10``:
13+
14+ .. code-block:: python
15+
16+ n = 10
17+ llaaf = LLAAF(torch.relu, n)
18+
19+ References:
20+ `A. D. Jagtap, K. Kawaguchi, & G. E. Karniadakis. Locally adaptive activation
21+ functions with slope recovery for deep and physics-informed neural networks.
22+ Proceedings of the Royal Society A, 476(2239), 20200334, 2020
23+ <https://doi.org/10.1098/rspa.2020.0334>`_.
24+ """
25+
726 def __init__ (self , activation , n ):
27+ """
28+ Initialize the L-LAAF module.
29+
30+ Args:
31+ activation: The activation function to use.
32+ n: The scaling factor.
33+ """
834 super ().__init__ ()
935 self .activation = activation
1036 self .n = n
You can’t perform that action at this time.
0 commit comments