Skip to content

Commit

Permalink
Compute boundary forcing dimensions separately
Browse files Browse the repository at this point in the history
  • Loading branch information
joeloskarsson committed Dec 3, 2024
1 parent b062df4 commit deb3338
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions neural_lam/models/ar_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,24 @@ def __init__(
persistent=False,
)

# Compute dimensionalities (e.g. to instantiate MLPs)
(
self.num_boundary_nodes,
boundary_static_dim,
) = self.boundary_static_features.shape
# TODO Compute boundary input dim separately
self.boundary_dim = self.grid_dim

# Compute boundary input dim separately
num_boundary_forcing_vars = datastore_boundary.get_num_data_vars(
category="forcing"
)
num_past_boundary_steps = args.num_past_boundary_steps
num_future_boundary_steps = args.num_future_boundary_steps
self.boundary_dim = (
boundary_static_dim
# Temporal Embedding counts as one additional forcing_feature
+ (num_boundary_forcing_vars + 1)
* (num_past_boundary_steps + num_future_boundary_steps + 1)
)

# Instantiate loss function
self.loss = metrics.get_metric(args.loss)
Expand Down

0 comments on commit deb3338

Please sign in to comment.