OpflowQNN.backward¶
- OpflowQNN.backward(input_data, weights)¶
Backward pass of the network.
- Parámetros:
input_data (float | list[float] | np.ndarray | None) – input data of the shape (num_inputs). In case of a single scalar input it is directly cast to and interpreted like a one-element array.
weights (float | list[float] | np.ndarray | None) – trainable weights of the shape (num_weights). In case of a single scalar weight
array. (it is directly cast to and interpreted like a one-element) –
- Devuelve:
The result of the neural network of the backward pass, i.e., a tuple with the gradients for input and weights of shape (output_shape, num_input) and (output_shape, num_weights), respectively.
- Tipo del valor devuelto:
tuple[np.ndarray | SparseArray | None, np.ndarray | SparseArray | None]