keras tutorial
choose download based on your OS. Create a new conda environment Launch anaconda prompt, this will open base Anaconda environment. Let us create a new conda environment. This process is similar to virtualenv command in your conda terminal: conda create --name PythonCPU If you want, you can create and install modules using GPU also. In this tutorial, we follow CPU instructions. Activate conda environment is an IDE for executing python applications. Let us install this IDE in our conda environment using the below command: conda install spyder Install python libraries We have already known the python0 码力 | 98 页 | 1.57 MB | 1 年前3PyTorch Release Notes
depend on Conda-specific packages, which might not be available on PyPI, we recommend building these packages from source. A workaround is to manually install a Conda package manager, and add the conda path PYTHONPATH for example, using export PYTHONPATH="/opt/conda/lib/python3.8/site-packages" if your Conda package manager was installed in /opt/conda. NVIDIA PyTorch Container Versions The following table depend on Conda-specific packages, which might not be available on PyPI, we recommend building these packages from source. A workaround is to manually install a Conda package manager, and add the conda path0 码力 | 365 页 | 2.94 MB | 1 年前3AI大模型千问 qwen 中文文档
我们建议您安装最新版本的 transformers 库,或者至少安装 4.37.0 版本。 1.1.1 Pip 安装 pip install transformers -U 1.1.2 Conda 安装 conda install conda-forge::transformers 1.1.3 从源码安装 pip install git+https://github.com/huggingface/transformers ,或者在 Windows 子系统 Linux(WSL)上运行 start_wsl.bat 。另外,你也可以选择手动在 conda 环境中安装所需的依赖项。这 里以 MacOS 系统为例进行实践操作。 conda create -n textgen python=3.11 conda activate textgen pip install torch torchvision torchaudio 根据 LLaMA-Factory 官方指引构建好你的环境 2. 安装下列代码库(可选): pip install deepspeed pip install flash-attn --no-build-isolation 3. 如你使用 FlashAttention-2 ,请确保你的 CUDA 版本在 11.6 以上。 准备数据 LLaMA-Factory 在 data 文件夹中提供了多0 码力 | 56 页 | 835.78 KB | 1 年前3PyTorch Tutorial
Chang Pranay Manocha Installing PyTorch • ???????????? On your own computer • Anaconda/Miniconda: conda install pytorch -c pytorch • Others via pip: pip3 install torch • ???????????? On Princeton CS server 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: conda/pip3 install jupyter • again... Misc • Alternative : Static Computation Graphs: Alternative: Static graphs Step 1: Build computational graph describing our computation (including finding paths for backprop) Step 2:0 码力 | 38 页 | 4.09 MB | 1 年前3【PyTorch深度学习-龙龙老师】-测试版202112
exe。或者点击开始菜单,输入“cmd”也可搜索到 cmd.exe 程序,打开即可。输入 conda list 命令即可查看 Python 环境已安装的库,如果是新安装的 Python 环境,则列出的 库都是 Anaconda 自带的软件库,如图 1.24 所示。如果 conda list 能够正常弹出一系列的库 列表信息,说明 Anaconda 软件安装成功;如果 conda 命令不能被识别,则说明安装失败, 需要重新安装。 PyTorch 和其他的 Python 库一样,使用 Python 包管理工具 pip install 命令即可安装。 官方推荐采用 conda install 命令安装。打开 https://pytorch.org/网页,选择 Windows 操作系 统、Conda 安装方式、Python 语言和 CUDA 版本,即可生成对应的安装命令,如图 1.30 预览版202112 第 1 章 人工智能绪论 图 1.30 PyTorch 安装命令 现在根据当前 CUDA 10.1 版本的情况,来安装 PyTorch GPU 最新版本,命令如下: # 安装 PyTorch GPU 版本 conda install pytorch torchvision cudatoolkit=10.1 -c pytorch 上述命令自动下载 PyTorch GPU 版本并安装,目前是 PyTorch 10 码力 | 439 页 | 29.91 MB | 1 年前3rwcpu8 Instruction Install miniconda pytorch
Initialize Miniconda: 2. If you want to use PyTorch, activate the pytorch conda environment: 3. There is also a conda environment for TensorFlow 2: 4. After you activate the corresponding environment ~/.tcshrc to ~/.cshrc_user : source "/export/data/miniconda3/etc/profile.d/conda.csh" conda activate pytorch conda activate tf2 python python_script.py wget https://repo.anaconda.com/miniconda 4.sh -b \ -p /rwproject/kdd-db/`whoami`/miniconda3 /rwproject/kdd-db/`whoami`/miniconda3/bin/conda init tcsh Since if ~/.tchsrc exists, ~/.cshrc_user won't be loaded, so you need to remove ~/0 码力 | 3 页 | 75.54 KB | 1 年前3动手学深度学习 v2.0
Python、Jupyter Notebook、相关库以及运行本书所需的代码,以快速入门并 获得动手学习经验。 安装 Miniconda 最简单的方法就是安装依赖Python 3.x的Miniconda8。如果已安装conda,则可以跳过以下步骤。访 问Miniconda网站,根据Python3.x版本确定适合的版本。 如果我们使用macOS,假设Python版本是3.9(我们的测试版本),将下载名称包含字符串“MacOSX”的bash脚 接下来,初始化终端Shell,以便我们可以直接运行conda。 ~/miniconda3/bin/conda init 现在关闭并重新打开当前的shell。并使用下面的命令创建一个新的环境: 8 https://conda.io/en/latest/miniconda.html 9 conda create --name d2l python=3.9 -y 现在激活 d2l 环境: conda activate d2l localhost:8888(通常会自动打开)。由此,我们可以运行这本书中每个 部分的代码。在运行书籍代码、更新深度学习框架或d2l软件包之前,请始终执行conda activate d2l以激活 运行时环境。要退出环境,请运行conda deactivate。 Discussions10 10 https://discuss.d2l.ai/t/2083 目录 11 12 目录 符号0 码力 | 797 页 | 29.45 MB | 1 年前3机器学习课程-温州大学-01深度学习-引言
安装PyTorch 命令行运行: 75 深度学习框架-PyTorch 测试PyTorch import torch x = torch.rand(2, 3) print(x) 或者输入 conda list -f pytorch 76 4. 深度学习的开发流程 01 深度学习概述 02 神经网络的基础 03 深度学习的背景知识 04 深度学习的开发流程0 码力 | 80 页 | 5.38 MB | 1 年前3《Efficient Deep Learning Book》[EDL] Chapter 7 - Automation
the global LEARNING_RATE and DROPOUT_RATE parameters from chapter 3. We have an additional function build_hp_model() here which takes a hp parameter that refers to a keras_tuner. HyperParameters() object type hyperparameters: learning_rate in range [.0001, .01] and dropout_rate in range [.1, .8]. The build_hp_model() is called by the tuner to create a model for each trial with the chosen values for the learning_rate and dropout_rate. DROPOUT_RATE = 0.2 LEARNING_RATE = 0.0002 NUM_CLASSES = 102 def build_hp_model(hp): if hp: learning_rate = hp.Float( "learning_rate", min_value=1e-4, max_value=1e-20 码力 | 33 页 | 2.48 MB | 1 年前3Keras: 基于 Python 的深度学习库
h5py 快速开始 38 如 果 模 块 导 入 没 有 错 误, 那 么 模 块 已 经 安 装 成 功, 否 则 你 可 以 在 http://docs.h5py.org/en/latest/build.html 中找到详细的安装说明。 模型 39 4 模型 4.1 关于 Keras 模型 在 Keras 中有两类主要的模型:Sequential 顺序模型 和 使用函数式 API 的 Model self.units = units self.state_size = units super(MinimalRNNCell, self).__init__(**kwargs) def build(self, input_shape): self.kernel = self.add_weight(shape=(input_shape[-1], self.units), initializer='uniform' Keras2.0 中,Keras 层的骨架(如果你用的是旧的版本,请你更新)。你只需要实 现三个方法即可: • build(input_shape): 这是你定义权重的地方。这个方法必须设 self.built = True,可 以通过调用 super([Layer], self).build() 完成。 • call(x): 这里是编写层的功能逻辑的地方。你只需要关注传入 call 的第一个参数:输入0 码力 | 257 页 | 1.19 MB | 1 年前3
共 23 条
- 1
- 2
- 3