3. Define the train data and initialize the parameters Let's have training data for a AND gate and initialize the parame
Posted: Tue Jul 05, 2022 10:25 am
3. Define the train data and initialize the parameters Let's have training data for a AND gate and initialize the parameters for an AND gate, where recall that the parameters imply weights such as bias, W1, and W2 for two inputs of an AND gate as we learned in class. For instance, you can define as follows, where "np" stands for "numpy" imported at the #1 step. # AND gate, last one is the output of an AND gate, [Input1, Input2, output] TrainData = np.array([[0,0,0], [0,1,0],[1,0,0],[1,1,1]]) # for AND gate b = np.random.normal(size=(1,)) # bias W1 = np.random.normal(size=(1,)) W2 = np.random.normal(size=(1,))