Neural Network Basics

  1. What does a neuron compute?

    答案:A neuron computes a linear function (z = Wx + b) followed by an activation function

    解析:Correct, we generally say that the output of a neuron is a = g(Wx + b) where g is the activation function (sigmoid, tanh, ReLU, ...).

  2. Consider the two following random arrays "a" and "b":

    a = np.random.randn(4, 3) # a.shape = (4, 3)
    b = np.random.randn(3, 2) # b.shape = (3, 2)
    c = a*b
    

    What will be the shape of "c"?

    答案:The computation cannot happen because the sizes don't match. It's going to be "Error"!

    解析:In numpy the "*" operator indicates element-wise multiplication. It is different from "np.dot()". If you would try "c = np.dot(a,b)" you would get c.shape = (4, 2).

原文地址:https://www.cnblogs.com/samniu/p/7620364.html