tune.py 412 B

123456789101112131415
  1. import fp
  2. C=fp.Coefficients()
  3. def erreur():
  4. L=flatten([[C.get(i,j) for i in range(j+1)] for j in range(1001)])
  5. R=flatten(load('65536.txt.sobj'))
  6. E=set([abs(L[i]-R[i]) for i in range(len(L))])
  7. return max(E)
  8. def surface(imax=1000):
  9. P=[]
  10. for j in range(imax+1):
  11. for i in range(j+1):
  12. P.append((i,j,exp(-C.get(i,j))))
  13. show(list_plot3d(P,interpolation_type='linear'))