#414The no-memory baselineEasyRNN
The no-memory baseline
Background
The naive way to apply a static network to a sequence is to run the same function on each timestep independently — no memory of the past:
with . Every output depends only on its own input, which is exactly what recurrence will later fix.
Problem statement
Implement per_timestep(X, w, b) applying to each timestep independently.
Input
X— array-like of shape(T, D): one input vector per timestep.w— array-like of lengthD.b—float.
Output
Returns an np.ndarray of shape (T,): one output per timestep.
Examples
Example 1
Input: X = [[1], [2], [3]], w = [1], b = 0
Output: [0.76159416 0.96402758 0.99505475]
Explanation: — each from its own input only.
Constraints
- For each row
x_t, computetanh(w · x_t + b). - Outputs are independent across time (no state carried).
- Return shape
(T,).
Notes
- Because each ignores every other timestep, this model can't tell
[up, up]from[up, down]at the same final point — the motivation for adding a hidden state.
Python
Loading...
▶ Run executes the 3 visible sample tests below in your browser. Submit runs the full suite — including hidden tests — on the server for an official verdict.
- •example per timestep
- •reference multifeature
- •sample with bias