MXNet
yrwang_xd
详情参见个人主页:https://yrwangxd.github.io/
展开
-
MXNet快速开始之自动微分
Basic usage from mxnet import nd from mxnet import autograd 示例f(x) = 2 x^2 x = nd.array([[1, 2], [3, 4]]) x 告知NDArray我们计划记录计算过程以计算梯度 x.attach_grad() 定义y=f(x),用autograd.record()便于之后计算梯度 with autograd.record(): y = 2 * x * x x.grad 输出: [[ 4. 8.] [1原创 2020-06-12 22:40:02 · 161 阅读 · 0 评论 -
MXNet快速开始之创建网络
from mxnet import nd from mxnet.gluon import nn Create your neural network’s first layer 创建一个dense layer with 2 output units. layer = nn.Dense(2) layer 输出: Dense(None -> 2, linear) 使用默认方式初始化层的权重, 即从 [−0.7,0.7] 均匀采样 layer.initialize() 用随机生成的数据演示前向传播 x原创 2020-06-12 20:29:35 · 300 阅读 · 0 评论 -
MXNet快速开始之Manipulate data with ndarray
mxnet的NDArray类似于NumPy的多维数组 Get started 首先,import ndarray package (nd is a shorter alias) from MXNet. # If you haven't installed MXNet yet, you can uncomment the following line to # install the latest stable release # !pip install -U mxnet from mxnet impor原创 2020-06-12 19:25:43 · 148 阅读 · 0 评论