import numpy as np v = np.array( [3, 4] ) print( "v = ", v ) dot_product = v.dot( v ) print( "dot product = ", dot_product ) magnitude = np.sqrt( v.dot( v ) ) print( "magnitude = ", magnitude ) base_natural_log = np.e print( "base of natural logarithms = ", base_natural_log ) print( "base of natural logarithms = ", np.exp( 1 ) ) print( "tanh( 0 ) = ", np.tanh( 0 ) ) print( "tanh( 1 ) = ", np.tanh( 1 ) ) print( "tanh( -1 ) = ", np.tanh( -1 ) ) print( "tanh( 5 ) = ", np.tanh( 5 ) ) print( "tanh( -5 ) = ", np.tanh( -5 ) ) sigmoid = lambda x: 1 / (1 + np.exp( - x )) print( "sigmoid(0) = ", sigmoid( 0 ) ) print( "sigmoid(5) = ", sigmoid( 5 ) ) print( "sigmoid(-5) = ", sigmoid( -5 ) ) w = np.array( [np.random.random() for i in range(10)] ) print( "array of 10 random numbers = ", w )