Programming, Artificial Intelligence, Machine Learning, Data Science, Python.
np.random.rand(4, 2) # Second layer weights (4x2 matrix) b2 = np.random.rand(2) # Second layer biases (2-dimensional vector) # Activation function: ReLU def relu(x): return np.maximum(0, x) # FFN function applying two layers of transformations def apply_ffn(x, W1, b1, W2, b2): # First layer