《Efficient Deep Learning Book》[EDL] Chapter 3 - Learning TechniquesEnglish to Spanish translation model. Let’s dig deeper into each of these categories using examples and code samples. Label Invariant Transformations Label invariant transformations transform samples such These values are clipped to 255. We will discuss some examples of image transformations below. The code samples are provided to bridge the theory and practice gap. We have prepared a few helper functions: image_path = 'file:///whalefin.png' Now, let’s go through the various image transformations with code examples. Rotation rotates the image pixels around the center. It is parameterized by . A positive0 码力 | 56 页 | 18.93 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 1 - Introductiontechniques (compression techniques, learning techniques, automation, efficient models & layers, infrastructure). Our hope is that even if you just read this chapter, you would be able to appreciate why we disposal to achieve what you want. The subsequent chapters will delve deeper into techniques, infrastructure, and other helpful topics where you can get your hands dirty with practical projects. With that goal with efficient deep learning is to have a collection of algorithms, techniques, tools, and infrastructure that work together to allow users to train and deploy pareto-optimal models that simply cost0 码力 | 21 页 | 3.17 MB | 1 年前3
阿里云上深度学习建模实践-程孟力语音标注 • 多场景模板:物体检 测、语音识别 • 数据集管理 • 主动学习 • 智能标注 itags AI SaaS服务(OCR、语音识别、推荐系统、金融风控、疾病预测等) Infrastructure PAI平台(Platform of Artificial Intelligence) • 一键部署、弹性扩缩 • 多框架、多语言 • 推理优化Blade • 多维度监控+报警0 码力 | 40 页 | 8.51 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 2 - Compression Techniqueslearning follow right after. The quantization section delves into the implementation details using code samples. We finish with a hands-on project that will walk you through the process of applying quantization contains the symbol-code mapping is transmitted along with the encoded data. Figure 2-1: Huffman Encoding & Huffman Tree. Source When decoding the encoded data, we look up the code from the lookup table back. Since the codes are unique for each symbol (in fact, they are prefix codes: no code is a prefix of some other code, which eliminates ambiguity when decoding), we can easily construct the original sequence0 码力 | 33 页 | 1.96 MB | 1 年前3
PyTorch Tutorial/Miniconda3-latest-Linux-x86_64.sh • After Miniconda is installed: conda install pytorch -c pytorch Writing code • Up to you; feel free to use emacs, vim, PyCharm, etc. if you want. • Our recommendations: • Install: 1234:localhost:1234 __@__.cs.princeton.edu • First blank is username, second is hostname Jupyter Notebook VS Code • Install the Python extension. • ???????????? Install the Remote Development extension. • Python Jupyter notebooks by delimiting cells/sections with #%% • Debugging PyTorch code is just like debugging any other Python code: see Piazza @108 for info. Also try Jupyter Lab! Why talk about libraries0 码力 | 38 页 | 4.09 MB | 1 年前3
keras tutorial Core Layers Convolution Layers Pooling Layers Recurrent Layers A simple python code to represent a neural network model using sequential model is as follows: from keras.models import your root directory under .keras/keras.json file. Keras backend module can be imported using below code: >>> from keras import backend as k If we are using default backend TensorFlow, then the below call and compute_output_shape completes the creating a customized layer. The final and complete code is as follows: from keras import backend as K from keras.layers import Layer Keras0 码力 | 98 页 | 1.57 MB | 1 年前3
PyTorch Brand Guidelinessocial media posts, please reference the digital RGB or hex code equivalent. When printing, please use CMYK or the listed Pantone code. For UI button elements, please reference “Color Variations communications. When using digitally, please use the hex code or RGB equivalent. When printing, please use CMYK or the listed Pantone code. 9 Brand Guidelines PyTorch Indigo (Digital+Print) social media posts, please reference the digital RGB or hex code equivalent. When printing, please use CMYK or the listed Pantone code. 9 Brand Guidelines PyTorch Super Light Gray (Digital+Print)0 码力 | 12 页 | 34.16 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 5 - Advanced Compression Techniquesrequired libraries to start with. We will use the gzip python module for demonstrating compression. The code for this exercise is available as a Jupyter notebook here. %%capture import gzip import operator same number of weights pruned. Phew! It feels like we have gone through a lot of talk without much code! In chapter four, we trained a model to predict masks for pets to build snapchat like filters. Let’s prunable block using magnitude-based pruning. Note that the below code is in addition to the original segmentation project in chapter four. The code for this project is available as a Jupyter notebook here.0 码力 | 34 页 | 3.18 MB | 1 年前3
AI大模型千问 qwen 中文文档AutoTokenizer device = "cuda" # the device to load the model onto # Now you do not need to add "trust_remote_code=True" model = AutoModelForCausalLM.from_pretrained( "Qwen/Qwen1.5-7B-Chat", torch_dtype="auto", device_map="auto" AutoTokenizer 借助 TextStreamer ,chat 的流式模式变得非常简单。下面我们将展示一个如何使用它的示例: ... # Reuse the code before `model.generate()` in the last code snippet from transformers import TextStreamer streamer = TextStreamer(tokenizer AutoTokenizer device = "cuda" # the device to load the model onto # Now you do not need to add "trust_remote_code=True" model = AutoModelForCausalLM.from_pretrained( "Qwen/Qwen1.5-7B-Chat", torch_dtype="auto", device_map="auto"0 码力 | 56 页 | 835.78 KB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 4 - Efficient Architectures[['efficient deep learning x123!']]).numpy()[0, :4] edl_sequence_output array([ 1, 1379, 1585, 1]) The code snippet above returns indices into the vocabulary we created in the previous step. Let's look up the TFHub14. These embeddings use a 250 dimensional vector to represent a token in the vocabulary. The below code snippet transforms the vocab tokens to their corresponding embeddings. import tensorflow_hub as tfhub word2vec_embeddings tensor should be (vocab_size, embedding_dim), i.e., (5000, 250). The following code snippet will verify that. embedding_dim = 250 # The shape of the word2vec_embeddings would be (vocabulary_size0 码力 | 53 页 | 3.92 MB | 1 年前3
共 18 条
- 1
- 2













