Calculate DW Wrapper Method
Functions
calculate_dW_wrapper(model, i, X, m)
Wrapper function to calculate the gradient of the weights for a specific layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model |
Sequential
|
The neural network model. |
required |
i |
int
|
Index of the current layer. |
required |
X |
ndarray
|
Input data (used for the first layer). |
required |
m |
int
|
Number of training examples. |
required |
Returns:
| Type | Description |
|---|---|
|
numpy.ndarray: Gradient of the weights for the specified layer. |