Replies: 6 comments 22 replies
-
A couple more ideas for this version of the model:
|
Beta Was this translation helpful? Give feedback.
-
Also, an option for farther down the road would be to take this approach but then add on a second layer of neural network after the GPP, ER and K are predicted that included a subset of the original predictors. This would allow for non-deterministic relationships between metabolism and oxygen concentrations that arise because of variation in stream temperatures, differences in groundwater inputs, or other types of process error. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Based on a suggestion from Bob, we could also edit the model equations at the top of the page such that we move from y_t to DO using DO-min rather than DO-mean. In other words, we predict DO-min as a function of ER, K, and maybe temperature, and then use DO-min combined with the weights and biases to predict DO-max and DO-mean in the subsequent equations. One question I still have that maybe @jsadler2 can help me with - is the equation {DO-mean_t = GPP_t + ER_t + Gas_t} deterministic, or does that line represent relationships that the model is able to learn? |
Beta Was this translation helpful? Give feedback.
-
I've started implementing this (#56) and run into a few questions that I'm hoping to get some feedback on: Here are the equations that I'm working toward implementing (I made some adjustments that I thought made sense in the And here is the code so far (from here): self.rnn_layer = layers.LSTM(
hidden_size,
return_sequences=True,
recurrent_dropout=recurrent_dropout,
dropout=dropout,
)
self.metab_out = layers.Dense(3)
self.do_range_multiplier = layers.Dense(1)
self.do_mean_wgt = layers.Dense(1)
def call(self, inputs, DO_sat):
h = self.rnn_layer(inputs)
metab = self.metab_out(h)
GPP = metab[:, :, 0]
ER = metab[:, :, 1]
K = metab[:, :, 2]
DO_min = DO_sat - ER + K
DO_max = DO_min + GPP - K
DO_mean = DO_min + self.do_range_multiplier(DO_max - DO_min) + tf.squeeze(self.do_mean_wgt(h))
return tf.stack((DO_min, DO_mean, DO_max, GPP, ER, K), axis=2) My questions
def call(self, inputs, DO_sat):
h = self.rnn_layer(inputs)
metab = self.metab_out(h)
GPP = metab[:, :, 0]
ER = metab[:, :, 1]
Gas= metab[:, :, 2]
DO_min = DO_sat - ER + Gas
DO_max = DO_min + GPP - Gas
DO_mean = DO_min + self.do_range_multiplier(DO_max - DO_min) + tf.squeeze(self.do_mean_wgt(h))
return tf.stack((DO_min, DO_mean, DO_max, GPP, ER, Gas), axis=2) I have one question about this approach: if we take this approach, should we somehow incorporate |
Beta Was this translation helpful? Give feedback.
-
Following up on our conversation this morning, these are the updated equations for DO min and max here, both Osat and K2 are calculated as a function of a temperature T - I've tried a few different ones below. Note that this formulation does require an estimate of depth (z) unless we want to train the model on k2, which we could calculate using the depth in the data release. First, here are some comparisons for how these equations work for predicting DO max and DO min using:
The good news is that it doesn't look like the differences in temperature choice are very important, and using the daily mean water temperature (or possibly even air temperature) would suffice. Second, in the equation for DO max above I've decided we should keep the GPP max calculation, but that means we need to add a timestep correction factor on ER and K2, which is different from what we talked about today in the meeting. That does mean we'd have to model within day light based on latitude and day of year, and that the estimates would change a little depending on the timestep we use to calculate it (but probably not by much). After fixing the ER timestep issue, this correction seems to work the best of all the options. Below I compare it to correcting to the average daily GPP based on daylength and to an uncorrected estimates for all three temperature methods above. |
Beta Was this translation helpful? Give feedback.
-
One possible approach to adding process guidance to the vanilla deep learning model is to explicitly represent the DO mass balance by outputting GPP, ER, and Gas exchange:
Baseline LSTM (#40):
Proposed:
This is based on the Odum equation for DO mass balance:
Beta Was this translation helpful? Give feedback.
All reactions