function E=grad_optm(W,Inp,Tar,NNP) [Y,G,E]=OneLay2(Inp,Tar,W,NNP);