《Efficient Deep Learning Book》[EDL] Chapter 3 - Learning Techniquesnotebook here. Tensorflow provides easy access to this dataset through the tensorflow-datasets package. Let’s start by loading the training and validation splits of the dataset. The make_dataset() function label 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 keras.losses as losses We will install the pydub dependency required by the tensorflow_datasets package for processing audio data, and load the speech_commands dataset from TFDS. !pip install pydub data_ds0 码力 | 56 页 | 18.93 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 4 - Efficient Architecturesloading the necessary modules. The Oxford-IIIT dataset is available through the tensorflow_datasets package. We apply the standard preprocessing routines to resize and normalize the images. import tensorflow ___________________ tds = train_prep_ds.cache().shuffle(1000, reshuffle_each_iteration=True) tds = tds.batch(BATCH_SIZE) vds = test_prep_ds.batch(256).cache() train(conv_model, tds, vds, epochs=EPOCHS) ___________________ tds = train_prep_ds.cache().shuffle(1000, reshuffle_each_iteration=True) tds = tds.batch(BATCH_SIZE) vds = test_prep_ds.batch(256).cache() train(dsc_model, tds, vds, epochs=EPOCHS)0 码力 | 53 页 | 3.92 MB | 1 年前3
动手学深度学习 v2.0'__all__', '__ �→builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', �→ '__spec__', 'bernoulli', 'beta', 'biject_to', 'binomial', 'categorical', 'cauchy' download(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: break0 码力 | 797 页 | 29.45 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
PyTorch Release Noteslater R515), 525.85 (or later R525), or 530.30 (or later R530). The CUDA driver's compatibility package only supports particular drivers. Thus, users should upgrade from all R418, R440, R460, and R520 manually install a Conda package manager, and add the conda path to your PYTHONPATH for example, using export PYTHONPATH="/opt/conda/lib/python3.8/site-packages" if your Conda package manager was installed later R515), 525.85 (or later R525), or 530.30 (or later R530). The CUDA driver's compatibility package only supports particular drivers. Thus, users should upgrade from all R418, R440, R460, and R5200 码力 | 365 页 | 2.94 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 5 - Advanced Compression Techniquescallbacks = [update_pruning] tds = train_prep_ds.cache().shuffle(1000, reshuffle_each_iteration=True).batch(BATCH_SIZE) vds = val_prep_ds.batch(256).cache() hist = train(model_for_pruning, tds, vds, epochs=EPOCHS0 码力 | 34 页 | 3.18 MB | 1 年前3
PyTorch Tutorialtorch.cuda.FloatTensor *Assume 't' is a tensor Autograd • Autograd • Automatic Differentiation Package • Don’t need to worry about partial differentiation, chain rule etc.. • backward() does that • loss a tensor Autograd (continued) • Manual Weight Update - example Optimizer • Optimizers (optim package) • Adam, Adagrad, Adadelta, SGD etc.. • Manually updating is ok if small number of weights • Imagine0 码力 | 38 页 | 4.09 MB | 1 年前3
Keras: 基于 Python 的深度学习库origin, untar=False, md5_hash=None, file_hash=None, cache_subdir='datasets', hash_algorithm='auto', extract=False, archive_format='auto', cache_dir=None) 从一个 URL 下载文件,如果它不存在缓存中。 默 认 情 况 下,URL origin md5_hash: 由于使用’file_hash’ 而已被弃用。用于校验的 md5 哈希值。 • file_hash: 下载后的文件的期望哈希字符串。支持 sha256 和 md5 两个哈希算法。 • cache_subdir: 在 Keras 缓存目录下的保存文件的子目录。如果指定了绝对路径 /path/to/folder,则文件将被保存在该位置。 • hash_algorithm: 选择哈希算法来校验文件。可选的有’md5’ bz 文件。默认’auto’ 为 [’tar’, ’zip’]。None 或空列表将返回未找到任何匹 配。ke xu az z’auto’, ’tar’, ’zip’, and None. • cache_dir: 存储缓存文件的位置,为 None 时默认为 Keras 目录. 返回 下载的文件的路径。 20.7 print_summary keras.utils.print_summary(model0 码力 | 257 页 | 1.19 MB | 1 年前3
TensorFlow on Yarn:深度学习遇上大数据Spark解决⽅案� • Coordinator负责协调生成ClusterSpec(扩展的TensorFlow gRPC server) • Worker通过读取RDD获取训练样本 • RDD的数据cache到内存或者磁盘供多次迭代训练使用 SparkFlow介绍 SparkFlow与TensorFlow on Yarn对比:� SparkFlow TensorFlow on Yarn0 码力 | 32 页 | 4.06 MB | 1 年前3
rwcpu8 Instruction Install miniconda pytorchthe activated environment, e.g.: 3. Install PyTorch It may be very slow to download the pytorch package, but that's not because you're installing PyTorch to a remote folder. It is a known problem that0 码力 | 3 页 | 75.54 KB | 1 年前3
共 13 条
- 1
- 2













