ubuntuKylin17.04使用Caffe2

前端之家收集整理的这篇文章主要介绍了ubuntuKylin17.04使用Caffe2前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

文章链接caffe2 安装与介绍


一早发现caffe2的较成熟的release版发布了(the first production-ready release),那么深度学习平台在之后一段时间也是会出现其与tensorflow相互竞争的局面。
从打开这个caffe2的官网就会发现,有了Facebook的支持,连界面也好看多了。不过再仔细看看,觉得又和tensorflow有一丝像,从内到外。

Caffe 2 Caffe2


Caffe2 中基本计算单元之一是 Operators。每个 Operator 包含给定适当数量和类型的输入和参数来计算输出所需的逻辑。Caffe 和 Caffe2 功能的总体差异如下图所示:

One of basic units of computation in Caffe2 are the Operators. Each operator contains the logic necessary to compute the output given the appropriate number and types of inputs and parameters. The overall difference between operators’ functionality in Caffe and Caffe2 is illustrated in the following graphic,respectively:


看到这段话,是不是更觉得像是tensorflow了?之前layer的概念被弱化,数据与操作完全分开,不就是tensorflow里面需要定义的tf.matmultf.Variable这类吗?
其次提出的workspace概念很像是tf中的Session:

# Create the input data
data = np.random.rand(16,100).astype(np.float32)

# Create labels for the data as integers [0,9].
label = (np.random.rand(16) * 10).astype(np.int32)

workspace.FeedBlob("data",data)
workspace.FeedBlob("label",label)

# Create model using a model helper
m = cnn.CNNModelHelper(name="my first net")
fc_1 = m.FC("data","fc1",dim_in=100,dim_out=10)
pred = m.Sigmoid(fc_1,"pred")
[softmax,loss] = m.SoftmaxWithLoss([pred,"label"],["softmax","loss"])

网络的编写也向tf靠拢了(学了点tf还是有点用的)。

最后还要说一点就是对Python支持大大增强了,当然这也是深度学习的趋势。

..........................................

安装测试成功

原文链接:https://www.f2er.com/ubuntu/352791.html

猜你在找的Ubuntu相关文章