Question: Using python write two functions in jupyter notebook The first function >> must calculate activation function activation() that must have these options (sigmoid , tanh

Using python write two functions in jupyter notebook The first function >> must calculate activation function activation() that must have these options (sigmoid , tanh , relu) The function takes z and the activation function name "as text" Example: activation(z, "sigmoid") note z is the output of Wx+b the function must return f(z) and if the user entered a wrong function name the function must print "wrong input" and return 0 The second function >> must calculate the loss function loss that must have these options(Mean Square Error "MSE", Mean Absolute Error "MAE", Negative Log Likelihood) the function takes y_predict ,y_true and the loss function name "as text" Example : loss(y_predict ,y_true, "MAE") note y_predict is the output of activation(z) the function must return loss(y_predict ,y_true) and if the user entered a wrong function name the function must print "wrong input" and return 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
