Skip to content

Commit

Permalink
changed placement of regularization in fnn constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Woolford committed Sep 7, 2024
1 parent b6253ca commit 7e38b0f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions deepxde/nn/pytorch/fnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def __init__(
self.activation = activations.get(activation)
initializer = initializers.get(kernel_initializer)
initializer_zero = initializers.get("zeros")
self.regularizer = regularization

self.linears = torch.nn.ModuleList()
for i in range(1, len(layer_sizes)):
Expand All @@ -33,9 +34,6 @@ def __init__(
)
initializer(self.linears[-1].weight)
initializer_zero(self.linears[-1].bias)
self.regularizer = regularization
# currently list with two components: regularization type, weight decay
# currently supports l2 regularization

def forward(self, inputs):
x = inputs
Expand Down

0 comments on commit 7e38b0f

Please sign in to comment.