Keras: 基于 Python 的深度学习库LSTM 模型 . . . . . . . . . . . . 15 3.2 函数式 API 指引 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.2.1 开始使用 Keras 函数式 API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 4.2 Sequential 顺序模型 API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4.2.1 Sequential 顺序模型 API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 4.3 函数式 API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4.3.1 Model 类 API . . . . . . . . . . . . . . . . . . . . . . .0 码力 | 257 页 | 1.19 MB | 1 年前3
keras tutorial..................................................... 55 Keras v Functional API .................................................................................................. techniques to make high level neural network API easier and more performant. It supports the following features: Consistent, simple and extensible API. Minimal structure - easy to achieve the learning library used for numerical computational tasks developed by Google. Keras is a high level API built on top of TensorFlow or Theano. We know already how to install TensorFlow using pip. If it0 码力 | 98 页 | 1.57 MB | 1 年前3
PyTorch Release Noteshighly optimized modules for popular Transformer architectures and an automatic mixed precision-like API that can be used seamlessly with your PyTorch code. ‣ A preview of Torch-TensorRT (1.4.0dev0) is now highly optimized modules for popular Transformer architectures and an automatic mixed precision-like API that can be used seamlessly with your PyTorch code. PyTorch Release 23.06 PyTorch RN-08516-001_v23 highly optimized modules for popular Transformer architectures and an automatic mixed precision-like API that can be used seamlessly with your PyTorch code. ‣ NVIDIA Deep Learning Profiler (DLProf) v1.80 码力 | 365 页 | 2.94 MB | 1 年前3
AI大模型千问 qwen 中文文档下,我们将展示如何使用 vLLM 构建一个与 OpenAI API 兼容的 API 服务。 首先,确保你已经安装 vLLM>=0.3.0 : pip install vllm 运行以下代码以构建 vllm 服务。此处我们以 Qwen1.5-7B-Chat 为例: python -m vllm.entrypoints.openai.api_server --model Qwen/Qwen1.5-7B-Chat OpenAI's API key and API base to use vLLM's API server. openai_api_key = "EMPTY" openai_api_base = "http://localhost:8000/v1" client = OpenAI( (续下页) 1.2. 快速开始 5 Qwen (接上页) api_key=openai_api_key, b base_url=openai_api_base, ) chat_response = client.chat.completions.create( model="Qwen/Qwen1.5-7B-Chat", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content":0 码力 | 56 页 | 835.78 KB | 1 年前3
【PyTorch深度学习-龙龙老师】-测试版202112Out[20]: tensor(2., requires_grad=True) True 除了在创建时指定参数是否需要计算梯度,还可以随时改变张量的属性,调用张量的 requires_grad_(mode)函数即可,例如 w.requires_grad_(False)即可将待优化张量转变为普通 张量。 PyTorch 的自动梯度功能只允许对待优化张量进行梯度计算,例如: In [21]: 2017 年开始, Keras 的大部分组件被整合到 TensorFlow 框架中。2019 年,在 TensorFlow 2 版本中,Keras 被正式确定为 TensorFlow 的高层唯一接口 API,取代了 TensorFlow 1 版本中自带的 tf.layers 等高层接口。也就是说,现在只能使用 Keras 的接口来完成 TensorFlow 层方式的 模型搭建与训练。在 TensorFlow TensorFlow 中,Keras 被实现在 tf.keras 子模块中。 Keras 与 tf.keras 有什么区别与联系呢?其实 Keras 可以理解为一套搭建与训练神经网 络的高层 API 协议,Keras 本身已经实现了此协议,安装标准的 Keras 库就可以方便地调用 TensorFlow、CNTK 等后端完成加速计算;在 TensorFlow 中,也实现了一套 Keras 协议, 即 tf0 码力 | 439 页 | 29.91 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 1 - Introductionproduction. BERT is used in Google Search to improve relevance of results, and GPT-3 is available as an API for interested users to consume. Having demonstrated the rapid growth of deep learning models, let Inference Efficiency By inference, we mean when the model is deployed and is in the prediction mode. Hence, inference efficiency primarily deals with questions that someone deploying a model would ask offline applications of these models. As an example, the Google Translate application supports offline mode which improves the user experience in low or no-connectivity areas. This is made possible with an0 码力 | 21 页 | 3.17 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 5 - Advanced Compression Techniquescompressed sizes of our regular model and its 50% sparse version. We used Tensorflow's save_model() API and zipped the model files using gzip. In addition to the usual models, the figure also shows compressed total number of bits required to encode a typical message can be minimized. Let’s try a non-linear mode of quantization where we can set the range of the buckets based on distribution of the data. One way tensorflow_model_optimization as tfmot You can now invoke the model clustering using the cluster_weights API by providing the model to be clustered and two important parameters: (1) the number of clusters, and0 码力 | 34 页 | 3.18 MB | 1 年前3
PyTorch TutorialAdvantages (continued) • Which one do you think is better? PyTorch! • Easy Interface − easy to use API. The code execution in this framework is quite easy. Also need a fewer lines to code in comparison • torch.no_grad() • Don’t store the history of all computations • eval() • Tell compiler which mode to run on. Visualization • TensorboardX (visualise training) • PyTorchViz (visualise computation0 码力 | 38 页 | 4.09 MB | 1 年前3
动手学深度学习 v2.03 提交主要更改 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764 16.6 d2l API 文档 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767 16.6 些情况下,我们通常会提供两个版本的示例:一个是我们从零开始实现一切,仅依赖张量操作和自动微分; 另一个是更实际的示例,我们使用深度学习框架的高级API编写简洁的代码。一旦我们教了您一些组件是如 何工作的,我们就可以在随后的教程中使用高级API了。 内容和结构 全书大致可分为三个部分,在 图1 中用不同的颜色呈现: 目录 3 图1: 全书结构 • 第一部分包括基础知识和预备知识。1节 经被TensorFlow26 (通常通过其高级API Keras27使用)、CNTK28、Caffe 229和Apache MXNet30所取代。第三代工具,即用 于深度学习的命令式工具,可以说是由Chainer31率先推出的,它使用类似于Python NumPy的语法来 描述模型。这个想法被PyTorch32、MXNet的Gluon API33和Jax34都采纳了。 “系统研究人员构建更0 码力 | 797 页 | 29.45 MB | 1 年前3
Lecture 6: Support Vector Machine⪰ 0, (α, β ) ∈ dom G and G > −∞ Often simplified by making implicit constraint (α, β ) ∈ dom G explicit Feng Li (SDU) SVM December 28, 2021 21 / 82 Weak Duality Weak duality: d∗ ≤ p∗ Always holds Kernelized SVM needs the support vectors at the test time (except when you can write φ(x) as an explicit, reasonably-sized vector) In the unkernelized version ω = � i:α∗ i >0 α∗ i y (i)x(i)+b∗ can be0 码力 | 82 页 | 773.97 KB | 1 年前3
共 33 条
- 1
- 2
- 3
- 4













