深度学习与PyTorch入门实战 - 32. Train-Val-Test-交叉验证Train-Val-Test划分 主讲人:龙良曲 Recap How to detect Splitting Train Set Test Set For example 60K 10K test while train train test trade-off Overfitt ing For others judge ▪ Kaggle Train Set Test0 码力 | 13 页 | 1.10 MB | 1 年前3
深度学习与PyTorch入门实战 - 63. 迁移学习-自定义数据集实战-networks-cnns/ Download ▪ 链接: https://pan.baidu.com/s/1V_ZJ7ufjUUFZwD2NHSNMFw ▪ 提取码:dsxl Splitting ▪ 皮卡丘:234 ▪ 超梦:239 ▪ 杰尼龟:223 ▪ 小火龙:238 ▪ 妙蛙种子:234 60%:138 20%:46 20%:46 4 steps ▪ Load data0 码力 | 16 页 | 719.15 KB | 1 年前3
深度学习与PyTorch入门实战 - 05. 手写数字问题你 好, MNIST 主讲人:龙良曲 DL is NOT a Toy ▪ MNIST ▪ each number owns 7000 images ▪ train/test splitting: 60k vs 10k NO deep learning, just function mapping ▪ X = [v1, v2, …, v784] ▪ X: [1, dx] ▪ H10 码力 | 10 页 | 569.56 KB | 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
《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
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
共 19 条
- 1
- 2













