Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dlist = [1, 2, 5, 10, 20, 50, 100, 200, 500, 1000]
- pytlist = []
- nptlist = []
- for d in dlist:
- U, X, Y = data.toy(100, 100, d)
- X = X.tolist()
- pya = time.process_time()
- pybatch(U, X, Y)
- pyb = time.process_time()
- pytlist += [pyb - pya]
- npa = time.process_time()
- pybatch(U, X, Y, nearest=npnearest)
- npb = time.process_time()
- nptlist += [npb - npa]
- plt.figure(figsize=(5, 3))
- plt.plot(dlist, pytlist, '-s', color='red')
- plt.plot(dlist, nptlist, '-o', color='blue')
- plt.xscale('log'); plt.yscale('log'); plt.xlabel('d'); plt.ylabel('time'); plt.grid(True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement