This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A simple neural network with 1 hidden layer and 4 neurons, an enhancement to the previous logistic regression to compute the XOR | |
@Author : Vinu Priyesh V.A. | |
""" | |
import numpy as np | |
#Compute functions for OR, AND, XOR, this will be used to generate the test set and to validate our results | |
def compute(x,m,label): | |
if(label == "XOR"): | |
return np.logical_xor(x[0,:],x[1,:]).reshape(1,m).astype(int) |