def create_curve():
# Create the curve which we want the RNN to learn
plt.ion()
fig = plt.figure(figsize=(10, 10))
ax = plt.gca()
r = np.arange(0, .34, 0.001)
n_points = len(r)
theta = 45 * np.pi * r
x_offset, y_offset = .5, .5
y_curve_points = 1.4 * r * np.sin(theta) + y_offset
x_curve_points = r * np.cos(theta) + x_offset
curve = list(zip(x_curve_points, y_curve_points))
collection = LineCollection([curve], colors='k')
ax.add_collection(collection)
return ax, n_points, x_curve_points, y_curve_points
rnn_curve_predict.py 文件源码
python
阅读 35
收藏 0
点赞 0
评论 0
评论列表
文章目录