def cross_enthropy_error(y,t): # not used..
  if y.ndim == 1:
    t = t.reshape(1,t.size)
    y = y.reshape(1,y.size)
  batch_size = y.shape(0)
  return -np.sum(t*np.log(y+1e-7))
def num_diff(f,x):
  h = 1e-4 # 0.0001
  return (f(x+h)-f(x-h))/(2*h)
def func_tmpx(x):
  return x*x + 4.0**2
def func_tmpy(y):
  return 3.0**2 + y*y
print(num_diff(func_tmpx,3))
print(num_diff(func_tmpy,4))
