NOAA-OWP / lstm

Other
10 stars 14 forks source link

Initialize all the possible forcings, and don't hard code any specific forcings. #8

Closed jmframe closed 2 years ago

jmframe commented 2 years ago

Short description explaining the high-level reason for the new issue. An LSTM can be trained with any combination of forcings, so don't hard code them. Let the BMI determine the forcings to include from the training configuration. But we can still initialize everything, and just not include them in the input tensor.

Current behavior

def initialize_forcings(self):
    #------------------------------------------------------------ 
    if 'total_precipitation' in self.cfg_train['dynamic_inputs']:
        self.total_precipitation = 0
    #------------------------------------------------------------ 
    if 'temperature' in self.cfg_train['dynamic_inputs']:
        self.temperature = 0

Expected behavior

    for forcing_name in self.cfg_train['dynamic_inputs']:
        setattr(self, forcing_name, 0)
jmframe commented 2 years ago

Fixed by PR #12