![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mxnet
文章平均质量分 51
这题我会啊
人工智能基本人工
展开
-
正确率计算
def acc(output, label):     # output: (batch, num_output) float32 ndarray     # label: (batch, ) int32 ndarray   &原创 2018-07-17 13:35:23 · 2207 阅读 · 0 评论 -
MXNet入门
按照官网60分钟入门 Gluon 来学的。ndarray定义手打普通数组: nd.array(((1,2,3),(5,6,7)))自动填充: nd.ones((2,3))随机填充: nd.random.uniform(-1,1,(2,3))指定数组填充: nd.full((2,3),2.0)ndarray也有属性: In: (X.shape, X.size...原创 2018-07-17 14:46:58 · 1486 阅读 · 0 评论 -
NDArray的一些性质
运算的内存开销前⾯例⼦⾥我们对每个操作新开内存来储存它的结果。例如即使是 y = x + y 我们也会新创建 内存,然后再将 y 指向新内存。为了展⽰这⼀点,我们可以使⽤ Python ⾃带的 id 函数:如果两 个实例的 ID ⼀致,那么它们所对应的内存地址相同;反之则不同。In [24]: before = id(y) y = y + x i...原创 2018-07-20 12:21:05 · 355 阅读 · 0 评论 -
线性回归
《动手学深度学习》上的例子手动搭建一个能学线性回归的函数(神经网络)def data_generate(): '''产生真实数据,这里维度为2,个数1000。同时我们增加了扰动(测量误差)''' number_inputs = 2 #dimension of input num_examples = 1000 true_w = [2, -3.4] ...原创 2018-07-20 14:56:45 · 307 阅读 · 0 评论