function E=grad(W,Inp,Tar,NNP) [Y,G,E]=ThreeLay(Inp,Tar,W,NNP);