Element–wise operations

In element-wise operations, position matters. Values that correspond positionally are combined to create a new value. 

To add to and/or subtract matrices or vectors:

 

And in Python:

vector_one = np.array([[1,2],[3,4]])vector_two = np.array([[5,6],[7,8]])    a + b    ## You should see:        array([[ 6, 8],[10, 12]])        array([[ 6, 8],[10, 12]])     a - b     ## You should see:         array([[-4, -4], [-4, -4]])

There are two forms of multiplication that we may perform with vectors: the Dot productand the Hadamard product.

The dot product is a special ...

Get Hands-On Artificial Intelligence for Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.