动手学深度学习 v2.0requests from IPython import display from matplotlib import pyplot as plt from matplotlib_inline import backend_inline d2l = sys.modules[__name__] 本书中的大部分代码都是基于PyTorch的。PyTorch是一个开源的深度学习框架,在研究界非常受欢迎。本书 h接近0。 为了更好地解释导数,让我们做一个实验。定义u = f(x) = 3x2 − 4x如下: %matplotlib inline import numpy as np from matplotlib_inline import backend_inline from d2l import torch as d2l def f(x): return 3 * x ** 2 - 4 use_svg_display())。 2.4. 微积分 65 def use_svg_display(): #@save """使用svg格式在Jupyter中显示绘图""" backend_inline.set_matplotlib_formats('svg') 我们定义set_figsize函数来设置图表大小。注意,这里可以直接使用d2l.plt,因为导入语句 from matplotlib0 码力 | 797 页 | 29.45 MB | 1 年前3
Experiment 2: Logistic Regression and Newton's Methodfor the sigmoid, so you will have to define it yourself. The easiest way to do this is through an inline expression: g = i n l i n e ( ’ 1.0 ./ ( 1 . 0 + exp(−z ) ) ’ ) ; % Usage : To find the value of0 码力 | 4 页 | 196.41 KB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 2 - Compression Techniqueswe will interpret the image in the form of a 2D matrix having values in [0.0, 1.0]. %matplotlib inline import matplotlib.pyplot as plt import matplotlib.image as mpimg img = (mpimg.imread('pia23378-160 码力 | 33 页 | 1.96 MB | 1 年前3
共 3 条
- 1













