《Efficient Deep Learning Book》[EDL] Chapter 4 - Efficient Architecturesfor mobile vision applications." arXiv preprint arXiv:1704.04861 (2017). On the other hand, a DSC block (figure 4-21) performs two step convolution. In the first step, the input is convolved with m (dk define a get_conv_builder() function that chooses between a regular convolution block and a depthwise convolution block. LEARNING_RATE = 0.001 N_CLASSES = 3 layer_id = -1 def get_layer_id(): global get_regular_conv_block(filters, strides): return tf.keras.Sequential( [ layers.Conv2D(filters, 3, padding='same', strides=strides), layers.BatchNormalization(), layers.ReLU(), ], name='regular_conv_block_' +0 码力 | 53 页 | 3.92 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 5 - Advanced Compression Techniquesstructure into the process of pruning. One way to do this is through pruning blocks of weights together (block sparsity). The blocks could be 1-D, 2-D or 3-D, and so on. Let’s start with a simple example of a neuron in the first layer to the neurons in the second layer as shown in figure 5-3. Figure 5-3: 1-D block pruning between two dense layers. The network on the right is the pruned version of the network on blocks. Our model achieved an accuracy of 85.11%. Here, we will prune the convolution blocks from block two (zero indexed) onwards. We will leave the deconvolution blocks untouched. We define a create_model_for_pruning()0 码力 | 34 页 | 3.18 MB | 1 年前3
动手学深度学习 v2.0download(name, cache_dir=os.path.join('..', 'data')): #@save """下载一个DATA_HUB中的文件,返回本地文件名""" assert name in DATA_HUB, f"{name} 不存在于 {DATA_HUB}" url, sha1_hash = DATA_HUB[name] os.makedirs(cache_dir, exist_ok=True) exist_ok=True) fname = os.path.join(cache_dir, url.split('/')[-1]) if os.path.exists(fname): sha1 = hashlib.sha1() with open(fname, 'rb') as f: while True: data = f.read(1048576) if not data: break 提供 越来越粗糙的抽象。就像半导体设计师从指定晶体管到逻辑电路再到编写代码一样,神经网络研究人员已经 从考虑单个人工神经元的行为转变为从层的角度构思网络,通常在设计架构时考虑的是更粗糙的块(block)。 之前我们已经介绍了一些基本的机器学习概念,并慢慢介绍了功能齐全的深度学习模型。在上一章中,我们 从零开始实现了多层感知机的每个组件,然后展示了如何利用高级API轻松地实现相同的模型。为了易于学0 码力 | 797 页 | 29.45 MB | 1 年前3
Keras: 基于 Python 的深度学习库= VGG19(weights='imagenet') model = Model(inputs=base_model.input, outputs=base_model.get_layer('block4_pool').output) img_path = 'elephant.jpg' img = image.load_img(img_path, target_size=(224, 224)) img_to_array(img) x = np.expand_dims(x, axis=0) x = preprocess_input(x) 预训练模型 APPLICATIONS 160 block4_pool_features = model.predict(x) 13.2.4 在新类上微调 InceptionV3 from keras.applications.inception_v3 : for i, layer in enumerate(base_model.layers): print(i, layer.name) # 我们选择训练最上面的两个 Inception block # 也就是说锁住前面 249 层,然后放开之后的层。 for layer in model.layers[:249]: layer.trainable = False for layer0 码力 | 257 页 | 1.19 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 3 - Learning Techniqueslabel train_ds = train_ds.map(dsitem_to_tuple).map(resize_image).cache() val_ds = val_ds.map(dsitem_to_tuple).map(resize_image).cache() print(train_ds.as_numpy_iterator().next()[0].shape) print(val_ds further regularization. dropout_rate = params.get('dropout_rate', 1.0) # We will keep the first 'block' of layers scale invariant. x = layers.Conv1D( 32, (9), padding='same', activation='relu', kern0 码力 | 56 页 | 18.93 MB | 1 年前3
AI大模型千问 qwen 中文文档[%(name)s] %(message)s", level=logging.INFO,␣ �→datefmt="%Y-%m-%d %H:%M:%S" ) model.quantize(data, cache_examples_on_gpu=False) 最后,保存量化模型: model.save_quantized(quant_path, use_safetensors=True) tokenizer 此外,vLLM 支持将 AWQ 或 GPTQ 模型与 KV 缓存量化相结合,即 FP8 E5M2 KV Cache 方案。例如: llm = LLM(model="Qwen/Qwen1.5-7B-Chat-GPTQ-Int8", quantization="gptq", kv_cache_dtype= �→"fp8_e5m2") python -m vllm.entrypoints.openai openai.api_server \ --model Qwen/Qwen1.5-7B-Chat-GPTQ-Int8 \ --quantization gptq \ --kv-cache-dtype fp8_e5m2 1.10.6 常见问题 您可能会遇到令人烦恼的 OOM(内存溢出)问题。我们推荐您尝试两个参数进行修复。第一个参数是 --max-model-len 。我们提供的默认最大位置嵌入(m0 码力 | 56 页 | 835.78 KB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 7 - Automationtransferable architectures for scalable image recognition. NASNet cells are composed of blocks. A single block corresponds to two hidden inputs, two primitive operations for the hidden states, and a combination operation as shown in figure 7-8 (left). NASNet predicts these five inputs and operations for every block. Each cell contains such blocks. Hence, for each cell, NASNet predicts parameters. Since we predict paper, the value for is chosen to be 5. Figure 7-8 (right) shows a predicted block. Figure 7-8: The structure of a block used to compose normal and reduction cells. The image on the left shows the timesteps0 码力 | 33 页 | 2.48 MB | 1 年前3
李东亮:云端图像技术的深度学习模型与应用视觉感知模型 分割 Forward Block Forward Block deconvolution deconvolution convolution convolution 检测 Forward Block Forward Block convolution convolution 识别 Forward Block Forward Block SACC2017 视觉感知模型-融合 Forward Block Forward Block deconvolution deconvolution convolution convolution 检测 Forward Block Forward Block convolution convolution 识别 Forward Block Forward Block Forward Block Forward Forward Block deconvolution deconvolution 分割 convolution convolution 检测 识别 Single Frame Predictor SACC2017 视觉感知模型-融合 检测 识别 分割 跟踪 核 心 深度学习 •完全基于深度学习 •统一分类,检测,分割,跟踪 ü通过共享计算提高算法效率 ü通过多个相关任务共同学习提高算法性能0 码力 | 26 页 | 3.69 MB | 1 年前3
PyTorch Release Notespaper. It is based on the regular ResNet model, which substitutes 3x3 convolutions in the bottleneck block for 3x3 grouped convolutions. This model script is available on GitHub. ‣ SE-ResNext model: This paper. It is based on the regular ResNet model, which substitutes 3x3 convolutions in the bottleneck block for 3x3 grouped convolutions. This model script is available on GitHub. ‣ SE-ResNext model: This paper. It is based on the regular ResNet model, which substitutes 3x3 convolutions in the bottleneck block for 3x3 grouped convolutions. This model script is available on GitHub. ‣ SE-ResNext model: This0 码力 | 365 页 | 2.94 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 6 - Advanced Learning Techniques - Technical Reviewillustration). Let the output of the -th residual block be denoted by . For the -th residual block, we start with the input from the previous residual block, . This input is branched into two, in one branch through a non-linearity (ReLU). Figure 6-16: A residual block in ResNet. Formally, it is computed as follows: . Note how in the residual block, the output of the previous layer ( ) skips the layers further by probabilistically dropping a residual block with a probability . The goal is to keep this probability high (less likelihood of dropping the given block) in the earlier layers, and low for later layers0 码力 | 31 页 | 4.03 MB | 1 年前3
共 17 条
- 1
- 2













