@takane takane / graph_turi.py
Created at Fri Oct 14 22:11:08 JST 2022
matplotlibでturicreateのアウトプットのグラフ化
graph.py
Raw
import numpy as np
import matplotlib.pyplot as plt

data01_axis1, data01_value1 = np.loadtxt("./kari2.txt", delimiter="|", usecols=range(1,3), unpack=True)

fig = plt.figure(figsize=(10, 6))
ax = fig.add_subplot(111)
ax.plot(data01_axis1, data01_value1, ".-", color="k", label="value1 of data01")
# ax.set_xlim(1000, 3000)
ax.set_xlabel("iterations")
ax.set_ylabel("Loss")
ax.legend(loc="upper left")
plt.show()

##+--------------+--------------+--------------+
##| Iteration    | Loss         | Elapsed Time |
##+--------------+--------------+--------------+
# | 1            | 3.34944      | 1.84s        |
# | 2            | 3.3227       | 2.36s        |
# | 3            | 3.31806      | 2.86s        |
# | 4            | 3.26582      | 3.33s        |
# | 5            | 3.19236      | 3.79s        |
@takane takane commented on 14 Oct 2022

IterationとLossのグラフを作成