function [GG,gg] = grd_sym (bb,xx,dFa,x0,N)

GG=cell(N,1);%1st order weight gradient
gg=cell(N,1);%1st order bias gradient


GG{1,1}=-diag(dFa{1,1})*bb{1,1}*(x0');% weight update
gg{1,1}=-diag(dFa{1,1})*bb{1,1};% bias update
  for i = 2:N
    GG{i,1}= -diag(dFa{i,1})*bb{i,1}*(xx{i-1,1}');
    gg{i,1}= -diag(dFa{i,1})*bb{i,1};
  end
end