MCPcopy Index your code
hub / github.com/pytorch/tutorials / plot

Function plot

advanced_source/pendulum.py:887–908  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

885
886
887def plot():
888 import matplotlib
889 from matplotlib import pyplot as plt
890
891 is_ipython = "inline" in matplotlib.get_backend()
892 if is_ipython:
893 from IPython import display
894
895 with plt.ion():
896 plt.figure(figsize=(10, 5))
897 plt.subplot(1, 2, 1)
898 plt.plot(logs["return"])
899 plt.title("returns")
900 plt.xlabel("iteration")
901 plt.subplot(1, 2, 2)
902 plt.plot(logs["last_reward"])
903 plt.title("last reward")
904 plt.xlabel("iteration")
905 if is_ipython:
906 display.display(plt.gcf())
907 display.clear_output(wait=True)
908 plt.show()
909
910
911plot()

Callers 1

pendulum.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected