You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

matplotlib_ani1.py 1.3 kB

6 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # ---
  2. # jupyter:
  3. # jupytext_format_version: '1.2'
  4. # kernelspec:
  5. # display_name: Python 3
  6. # language: python
  7. # name: python3
  8. # language_info:
  9. # codemirror_mode:
  10. # name: ipython
  11. # version: 3
  12. # file_extension: .py
  13. # mimetype: text/x-python
  14. # name: python
  15. # nbconvert_exporter: python
  16. # pygments_lexer: ipython3
  17. # version: 3.5.2
  18. # ---
  19. # ## Animation
  20. #
  21. # +
  22. # %matplotlib inline
  23. import numpy as np
  24. import matplotlib.pyplot as plt
  25. from matplotlib import animation, rc
  26. from IPython.display import HTML
  27. # First set up the figure, the axis, and the plot element we want to animate
  28. fig, ax = plt.subplots()
  29. ax.set_xlim(( 0, 2))
  30. ax.set_ylim((-2, 2))
  31. line, = ax.plot([], [], lw=2)
  32. # +
  33. # initialization function: plot the background of each frame
  34. def init():
  35. line.set_data([], [])
  36. return (line,)
  37. # animation function. This is called sequentially
  38. def animate(i):
  39. x = np.linspace(0, 2, 1000)
  40. y = np.sin(2 * np.pi * (x - 0.01 * i))
  41. line.set_data(x, y)
  42. return (line,)
  43. # call the animator. blit=True means only re-draw the parts that have changed.
  44. anim = animation.FuncAnimation(fig, animate, init_func=init,
  45. frames=100, interval=20, blit=True)
  46. HTML(anim.to_html5_video())

机器学习越来越多应用到飞行器、机器人等领域,其目的是利用计算机实现类似人类的智能,从而实现装备的智能化与无人化。本课程旨在引导学生掌握机器学习的基本知识、典型方法与技术,通过具体的应用案例激发学生对该学科的兴趣,鼓励学生能够从人工智能的角度来分析、解决飞行器、机器人所面临的问题和挑战。本课程主要内容包括Python编程基础,机器学习模型,无监督学习、监督学习、深度学习基础知识与实现,并学习如何利用机器学习解决实际问题,从而全面提升自我的《综合能力》。

Contributors (1)