《Efficient Deep Learning Book》[EDL] Chapter 5 - Advanced Compression Techniquesnum_quantization_bits): # num_elements = img.size return (num_elements * num_quantization_bits) / 8.0 def get_clustered_size_bytes(num_elements, num_clusters, floating_point_word_size=4): codebook_size_bytes * floating_point_word_size encoded_img_size_bytes = (num_elements * np.math.log2(num_clusters)) / 8.0 return codebook_size_bytes + encoded_img_size_bytes def compute_compression_ratio(num_elements,0 码力 | 34 页 | 3.18 MB | 1 年前3
动手学深度学习 v2.0通俗地说,ReLU函数通过将相应的活性值设为0,仅保留正元素并丢弃所有负元素。为了直观感受一下,我 们可以画出函数的曲线图。正如从图中所看到,激活函数是分段线性的。 x = torch.arange(-8.0, 8.0, 0.1, requires_grad=True) y = torch.relu(x) d2l.plot(x.detach(), y.detach(), 'x', 'relu(x)', figsize=(5 数为什么会导致梯度消失。 %matplotlib inline import torch from d2l import torch as d2l x = torch.arange(-8.0, 8.0, 0.1, requires_grad=True) y = torch.sigmoid(x) (continues on next page) 166 4. 多层感知机 (continued 1的输入张量X和卷积核张量K,我们来验证上述二维互相关运算的输出。 X = torch.tensor([[0.0, 1.0, 2.0], [3.0, 4.0, 5.0], [6.0, 7.0, 8.0]]) K = torch.tensor([[0.0, 1.0], [2.0, 3.0]]) corr2d(X, K) tensor([[19., 25.], [37., 43.]]) 60 码力 | 797 页 | 29.45 MB | 1 年前3
共 2 条
- 1













