import numpy as np
from matplotlib import pyplot as plt
def set_figsize(figsize=(3.5, 2.5)):
"""设置matplotlib的图表大小。"""
plt.rcParams['figure.figsize'] = figsize
def set_axes(axes, xlabel, ylabel, xlim, ylim, xscale, yscale, legend):
"""设置matplotlib的轴。"""
axes.set_xlabel(xlabel)
axes.set_ylabel(ylabel)
axes.set_xscale(xscale)
axes.set_yscale(yscale)
axes.set_xlim(xlim)
axes.set_ylim(ylim)
if legend:
axes.legend(legend)
axes.grid()
def plot(X, Y=None, xlabel=None, ylabel=None, legend=None, xlim=None, ylim=None, xscale='linear', yscale='linear',
fmts=('-', 'm--', 'g-.', 'r:'), axes=None):
"""绘制数据点。"""
if legend is None:
legend = []
修复深度学习代码缩进问题与运行环境冲突

这篇博客讨论了在学习深度学习过程中遇到的代码格式问题,主要是在复制代码后出现IndentationError。作者提供了解决方案,即在记事本中删除空格并重新添加,以解决Markdown导致的格式问题。同时,提到了在Jupyter环境中使用%matplotlib inline命令时的语法错误,导致无法正常生成图像的问题。
最低0.47元/天 解锁文章
8万+





