Spark MLlib Deep Learning Deep Belief Network (深度学习-深度信念网络)2.3

http://blog.csdn.net/sunbow0

第二章Deep Belief Network (深度信念网络)

实例

3.1 測试数据

依照上例数据,或者新建图片识别数据。

3.2 DBN实例

(读取固定样本:来源于经典优化算法測试函数Sphere
Model)***********//

//2 读取样本数据

Logger.getRootLogger.setLevel(Level.WARN)

valdata_path ="/user/huangmeiling/deeplearn/data1"

valexamples =sc.textFile(data_path).cache()

valtrain_d1 =examples.map { line =>

valf1 = line.split("\t")

valf =f1.map(f =>f.toDouble)

)

))

,f.length)

(,y.length,y),new
BDM(,x.length,x))

}

valtrain_d =train_d1.map(f => (f._2,
f._3))

valopts = Array(100.0,20.0,0.0)

//3 设置训练參数,建立DBN模型

valDBNmodel =new DBN().

setSize(Array(,
)).

setLayer().

setMomentum(0.1).

setAlpha(1.0).

DBNtrain(train_d,
opts)

//4 DBN模型转化为NN模型

)

valnnopts = Array(100.0,50.0,0.0)

valnumExamples =train_d.count()

println(s"numExamples = $numExamples.")

println(mynn._2)

tomynn._1.length
-) {

print(mynn._1(i) +"\t")

}

println()

println("mynn_W1")

)

totmpw1.rows
-) {

totmpw1.cols
-) {

print(tmpw1(i,j) +"\t")

}

println()

}

valNNmodel =new NeuralNet().

setSize(mynn._1).

setLayer(mynn._2).

setActivation_function("sigm").

setOutput_function("sigm").

setInitW(mynn._3).

NNtrain(train_d,
nnopts)

//5 NN模型測试

valNNforecast =NNmodel.predict(train_d)

valNNerror =NNmodel.Loss(NNforecast)

println(s"NNerror = $NNerror.")

),
f.)

println("预測结果——实际值:预測值:误差")

untilprintf1.length)

println(printf1(i)._1 +"\t"
+printf1(i)._2 +"\t"
+ (printf1(i)._2 -printf1(i)._1))

转载请注明出处:

http://blog.csdn.net/sunbow0

Spark MLlib Deep Learning Deep Belief Network (深度学习-深度信念网络)2.3的更多相关文章

  1. Spark MLlib Deep Learning Deep Belief Network (深度学习-深度信念网络)2.1

    Spark MLlib Deep Learning Deep Belief Network (深度学习-深度信念网络)2.1 http://blog.csdn.net/sunbow0 Spark ML ...

  2. Spark MLlib Deep Learning Deep Belief Network (深度学习-深度信念网络)2.2

    Spark MLlib Deep Learning Deep Belief Network (深度学习-深度信念网络)2.2 http://blog.csdn.net/sunbow0 第二章Deep ...

  3. Spark MLlib Deep Learning Convolution Neural Network (深度学习-卷积神经网络)3.1

    3.Spark MLlib Deep Learning Convolution Neural Network (深度学习-卷积神经网络)3.1 http://blog.csdn.net/sunbow0 ...

  4. Spark MLlib Deep Learning Convolution Neural Network (深度学习-卷积神经网络)3.2

    3.Spark MLlib Deep Learning Convolution Neural Network(深度学习-卷积神经网络)3.2 http://blog.csdn.net/sunbow0 ...

  5. Spark MLlib Deep Learning Convolution Neural Network (深度学习-卷积神经网络)3.3

    3.Spark MLlib Deep Learning Convolution Neural Network(深度学习-卷积神经网络)3.3 http://blog.csdn.net/sunbow0 ...

  6. Deep Learning 17:DBN的学习_读论文“A fast learning algorithm for deep belief nets”的总结

    1.论文“A fast learning algorithm for deep belief nets”的“explaining away”现象的解释: 见:Explaining Away的简单理解 ...

  7. 调参侠的末日? Auto-Keras 自动搜索深度学习模型的网络架构和超参数

    Auto-Keras 是一个开源的自动机器学习库.Auto-Keras 的终极目标是允许所有领域的只需要很少的数据科学或者机器学习背景的专家都可以很容易的使用深度学习.Auto-Keras 提供了一系 ...

  8. 深度学习图像分割——U-net网络

    写在前面: 一直没有整理的习惯,导致很多东西会有所遗忘,遗漏.借着这个机会,养成一个习惯. 对现有东西做一个整理.记录,对新事物去探索.分享. 因此博客主要内容为我做过的,所学的整理记录以及新的算法. ...

  9. 深度学习|基于LSTM网络的黄金期货价格预测--转载

    深度学习|基于LSTM网络的黄金期货价格预测 前些天看到一位大佬的深度学习的推文,内容很适用于实战,争得原作者转载同意后,转发给大家.之后会介绍LSTM的理论知识. 我把code先放在我github上 ...

随机推荐

  1. CUGBACM_Summer_Tranning 组队赛解题报告

    组队赛解题报告: CUGBACM_Summer_Tranning 6:组队赛第六场 CUGBACM_Summer_Tranning 5:组队赛第五场 CUGBACM_Summer_Tranning 4 ...

  2. spring-data-mongodb必须了解的操作

    http://docs.spring.io/spring-data/data-mongo/docs/1.0.0.M5/api/org/springframework/data/mongodb/core ...

  3. Understanding Abstractions of Secure Channels 的研读

  4. [Angular 2] Using the @Inject decorator

    TypeScript is used heavily as we build up our application, but TypeScript isn’t required. If you wan ...

  5. [Javascript] Call Stack

    Every time when a function run it will be push into the call stack and put on the top,  you can thin ...

  6. iOS会议和组织

    全世界有许多iOS会议和组织,如果你没有机会去参加,知道他们的存在和向他们学习对你也是有益的.事实上,他们中有些提供免费的幻灯片.视频,有用资料等,所以你不能够忽视他们. 有一些会议的主题并不仅仅关于 ...

  7. CodeSmith使用总结--创建一个基础模板

    问:为什么要用CodeSmith? 答曰:因为我懒的写. Codesmith是一款非常不错的懒人工具,我也经常会用到,因为它在“重复代码”方面能够节省我们很多时间,并且解除了我们重复繁琐并且乏味的“码 ...

  8. .net中div置于顶层+iframe

    aspx代码: <td>  <asp:Button ID="BtnDownPPT" runat="server" OnClientClick= ...

  9. sqlserver2005重新安装(安装汇编错误,安装程序无法连接到数据库服务进行服务配置)

    2014-01-09 16:41 1687人阅读 评论(1) 收藏 举报 分类: 数据库(1) 版权声明:本文为博主原创文章,未经博主允许不得转载. sqlserver2005重新安装(安装汇编错误, ...

  10. DataSource

    数据库连接池原理:在内存中开辟一段存储空间用来存储多个Connection连接,避免频繁的创建Connection,从而提高效率.代码如下: package jcbc.ds.test1; import ...