Lyft-inspired ETA model processes a sequence of trip events with a compact recurrent unit. You need to perform one LSTM cell update from the already-activated input, forget and output gates, the candidate values and the previous cell state.
Compute one LSTM cell update from already activated gate values: i, f, o are the input, forget and output gate activations (in (0,1)), g is the candidate cell value and c_prev is the previous cell state. The new cell state is c=f⊙cprev+i⊙g and the new hidden state is h=o⊙tanh(c).
Implement solve(i,f,o,g,c_prev).
Returns. Return a tuple (h, c) of NumPy vectors.
Example 1
Input:
solve([0.5, 0.5], [0.9, 0.9], [1.0, 1.0], [0.2, -0.2], [0.0, 0.0])
Output:
([0.099668, -0.099668], [0.1, -0.1])
Example 2
Input:
solve([0.0], [1.0], [1.0], [5.0], [2.0])
Output:
([0.964028], [2.0])
No results yet
Run your code to check it against the examples, or submit to run every test.