《Efficient Deep Learning Book》[EDL] Chapter 4 - Efficient Architecturesanimals. The higher the value, the more that particular feature represents the given animal. In Table 4-1 we manually assigned values for the cute and dangerous features for six animals2, and we are calling cat (0.95, 0.05) snake (0.01, 0.9) bear (0.5, 0.95) raccoon (0.5, 0.5) mouse (0.01, 0.2) Table 4-1: A table consisting of embeddings of the various animals, using two features (cute and dangerous), each take a value between 0.0 and 1.0. We manually picked these values for illustration. Going through table 4-1, cat and dog have high values for the ‘cute’ feature, and low values for the ‘dangerous’ feature0 码力 | 53 页 | 3.92 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 3 - Learning Techniquesfamiliarize ourselves with these techniques later in this chapter. Table 3-1 presents a concise summary of both, sample and label efficiency. Table 3-1: A quick summary of sample and label efficiencies. Both Using learning techniques to build smaller and faster efficient models Overall, as summarized in table 3-1, improving sample efficiency enables faster model training, and label efficiency is useful to scenario which illustrates how learning techniques are leveraged to reduce the model footprint. Table 3-2 shows a comparison of vanilla models (without the learning techniques) with the models that employ0 码力 | 56 页 | 18.93 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 2 - Compression Techniquesaggregate, this would be better than encoding each symbol with the same number of bits. The lookup table (figure 2-1 middle) that contains the symbol-code mapping is transmitted along with the encoded data Encoding & Huffman Tree. Source When decoding the encoded data, we look up the code from the lookup table to retrieve the symbols back. Since the codes are unique for each symbol (in fact, they are prefix we can easily construct the original sequence of symbols from the encoded sequence and the lookup table. Refer the wikipedia article on arithmetic coding to learn about lossless coding schemes. The lossy0 码力 | 33 页 | 1.96 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 7 - Automation.1), (20, .001), (50, .1), ] The create_model() function creates a single hidden layer model whose size is determined by the input size parameter. def create_model(size): return tf.keras.Sequential([ hyperparameters. search_results = [] for trial_id, (layer_size, learning_rate) in enumerate(S): model = create_model(size=layer_size) opt = optimizers.SGD(learning_rate=learning_rate) losses = [] for iteration r is smaller and vice-versa to ensure that each bracket gets a comparable budget. Take a look at table 7-1 which shows the changes in the number of configurations as the iterations progress for each bracket0 码力 | 33 页 | 2.48 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 5 - Advanced Compression Techniquesweights to zero. def sparsify_smallest(w, sparsity_rate): w = w.copy() w_1d = np.reshape(w, (-1)) # Create a list of indices sorted by the absolute magnitude of the weights. w_1d_sorted_indices = np.argsort(np compress(w.tobytes()) return compressed_w To demonstrate the effect of sparsity on compression, we create a sample 2D weight matrix with randomly initialized float values. We also define a sparsity_rate pets to build snapchat like filters. Let’s continue on the same project to demonstrate how we can create a pruned network without significant drop in accuracy in the next section. 4 Elsen, E., Dukhan,0 码力 | 34 页 | 3.18 MB | 1 年前3
PyTorch Release NotesRN-08516-001_v23.07 | July 2023 PyTorch Release Notes PyTorch RN-08516-001_v23.07 | ii Table of Contents Chapter 1. PyTorch Overview......................................................... Conda package manager was installed in /opt/conda. NVIDIA PyTorch Container Versions The following table shows what versions of Ubuntu, CUDA, PyTorch, and TensorRT are supported in each of the NVIDIA containers Conda package manager was installed in /opt/conda. NVIDIA PyTorch Container Versions The following table shows what versions of Ubuntu, CUDA, PyTorch, and TensorRT are supported in each of the NVIDIA containers0 码力 | 365 页 | 2.94 MB | 1 年前3
keras tutorialplease notify us at contact@tutorialspoint.com Keras iii Table of Contents About the Tutorial ................................................................ ........................................................................................... ii Table of Contents ..................................................................................... ........................................................................................... 63 Create a Multi-Layer Perceptron ANN ...................................................................0 码力 | 98 页 | 1.57 MB | 1 年前3
Keras: 基于 Python 的深度学习库. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 6.1.4 make_sampling_table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 6.2 文本预处理 . . . . . . . . . . . RuntimeError: 如果模型从未编译。 例 def generate_arrays_from_file(path): while 1: f = open(path) for line in f: # create Numpy arrays of input data # and labels, from each line in the file x, y = process_line(line) output_dim = output_dim super(MyLayer, self).__init__(**kwargs) def build(self, input_shape): # Create a trainable weight variable for this layer. self.kernel = self.add_weight(name='kernel', shape=(input_shape[1]0 码力 | 257 页 | 1.19 MB | 1 年前3
【PyTorch深度学习-龙龙老师】-测试版202112在模型端,需要创建写入监控数据的 Summary 类,并在需要的时候写入监控数据。首 先通过 tf.summary.create_file_writer 创建监控对象类实例,并指定监控数据的写入目录,代 码如下: # 创建监控类,监控数据将写入 log_dir 目录 summary_writer = tf.summary.create_file_writer(log_dir) 我们以监控误差数据和可视化图片数据为例,介绍如何写入监控数据。在前向计算完 在模型端,需要创建写入监控数据的 Summary 类,并在需要的时候写入监控数据。首 先通过 tf.summary.create_file_writer 创建监控对象类实例,并指定监控数据的写入目录,代 码如下: # 创建监控类,监控数据将写入 log_dir 目录 summary_writer = tf.summary.create_file_writer(log_dir) 我们以监控误差数据和可视化图片数据为例,介绍如何写入监控数据。在前向计算完 vocab,?) Embedding 层实现起来非常简单,构建一个 shape 为[?vocab,?]的查询表对象 table,对 预览版202112 11.1 序列表示方法 3 于任意的单词编号?,只需要查询到对应位置上的向量并返回即可: ? = table[?] Embedding 层是可训练的,它可放置在神经网络之前,完成单词到向量的转换,得到的表 示向量可以继续0 码力 | 439 页 | 29.91 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 1 - Introductionwords, the models generalized well). As a result of this trailblazing work, there has been a race to create deeper networks with an ever larger number of parameters and increased complexity. In Computer Vision leads to a direct increase in model size and memory consumption. Figure 1-16: A regular embedding table on the left with an embedding for each token. Hashing Trick on the right, where multiple tokens map0 码力 | 21 页 | 3.17 MB | 1 年前3
共 27 条
- 1
- 2
- 3













