Previous question · 1190
Roman to Integer
easyMath
Next question · 1192
Convert Sorted Array to BST
easyData Structures
Random coding question

1191. GRU forward pass

medium
GeneralGeneral
staff
Function contract
Inputs
X
np.ndarray
h0
np.ndarray
params
dict
Returns
value
np.ndarray

Examples

Input
{
  "X": [
    [
      0.2,
      -0.1
    ],
    [
      0,
      0.3
    ]
  ],
  "h0": [
    0,
    0
  ],
  "params": {
    "Uh": [
      [
        0.3,
        0
      ],
      [
        0,
        0.3
      ]
    ],
    "Ur": [
      [
        0.2,
        0
      ],
      [
        0,
        0.2
      ]
    ],
    "Uz": [
      [
        0.4,
        0
      ],
      [
        0,
        0.4
      ]
    ],
    "Wh": [
      [
        0.6,
        0.2
      ],
      [
        -0.1,
        0.5
      ]
    ],
    "Wr": [
      [
        -0.2,
        0.1
      ],
      [
        0.3,
        -0.4
      ]
    ],
    "Wz": [
      [
        0.5,
        -0.3
      ],
      [
        0.1,
        0.2
      ]
    ],
    "bh": [
      0,
      0
    ],
    "br": [
      0,
      0
    ],
    "bz": [
      0,
      0
    ]
  }
}
Output
[
  [
    0.05306865294704585,
    -0.0349429451582145
  ],
  [
    0.060285795275840055,
    0.0566286106264826
  ]
]

Constraints

Hint 1
Hint 2
Hint 3
Roles
ML Engineer
AI Engineer
Data Scientist
Research Scientist
Companies
GeneralGeneral
Levels
staff
senior
entry
Tags
GRU
RNN-forward-pass
NumPy-linear-algebra
sequence-modeling

Similar Questions

Linear Regressionmedium
ML Coding
Activation function relueasy
ML Coding
Text normalizationmedium
ML Coding
44 people are solving this problem
Loading editor for the selected language
Ln 1, Col 1
Program Output
DATAINTERVIEW
Interactive coding terminal
Python / NumPy environment ready.
Type a command below or run code from the editor.
run scriptExecute the current editor contents
submitGrade the current editor contents against all solution test cases
python ("print hello world")Run an isolated Python command
helpShow all available commands