Skip to content

Commit

Permalink
[neural-networks] use dimension of parameters instead of length
Browse files Browse the repository at this point in the history
  • Loading branch information
HenKlei committed Mar 29, 2021
1 parent 914a407 commit 5a3fb25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pymor/reductors/neural_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def reduce(self, hidden_layers='[(N+P)*3, (N+P)*3]', activation_function=torch.t

def _compute_layer_sizes(self, hidden_layers):
"""Compute the number of neurons in the layers of the neural network."""
return [len(self.fom.parameters), ] + hidden_layers + [len(self.reduced_basis), ]
return [self.fom.parameters.dim, ] + hidden_layers + [len(self.reduced_basis), ]

def _build_rom(self):
"""Construct the reduced order model."""
Expand Down Expand Up @@ -297,7 +297,7 @@ def _compute_layer_sizes(self, hidden_layers):
"""Compute the number of neurons in the layers of the neural network
(make sure to increase the input dimension to account for the time).
"""
return [len(self.fom.parameters) + 1] + hidden_layers + [len(self.reduced_basis)]
return [self.fom.parameters.dim + 1, ] + hidden_layers + [len(self.reduced_basis), ]

def _build_rom(self):
"""Construct the reduced order model."""
Expand Down

0 comments on commit 5a3fb25

Please sign in to comment.