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. Android SDK及ADT更新访问问题的解决办法

    一.访问问题Eclipse使用SDK Manager更新时总是出现问题 Failed to fetch URL https://dl-ssl.google.com/android/repository ...

  2. hdu 5080 2014ACM/ICPC鞍山K题 polya计数

    首先,中心点是能够直接算出来的 把全部的坐标相加再除n就能够 然后枚举一个不靠近中心的点,枚举它绕中心点旋转的角度.仅仅要枚举50次就能够了 计算出当前枚举的的角度能否形成一个置换群 计算循环节,再用 ...

  3. 深入解析MySQL replication协议

    Why 最开始的时候,go-mysql只是简单的抽象mixer的代码,提供一个基本的mysql driver以及proxy framework,但做到后面,笔者突然觉得,既然研究了这么久mysql c ...

  4. 用CSS3写的钟表

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  5. mysql查询分组归类函数-group_concat,通常与group_by一起使用

    select a.`name`,group_concat(b.name SEPARATOR'.') as persons from `group` as a,`person` as b,`person ...

  6. [TYVJ] P1026 犁田机器人

    犁田机器人 背景 Background USACO OCT 09 2ND   描述 Description Farmer John為了让自己从无穷无尽的犁田工作中解放出来,於是买了个新机器人帮助他犁田 ...

  7. PostgreSQL的时间函数使用整理

    PG的时间函数使用整理如下 1.获取系统时间函数 select now(); --2012-05-12 18:51:59.562+08 select current_timestamp; --2012 ...

  8. 动态修改ActionBar Menu的显示

    应用场景: 在主Activity中,采用InstrumentedActivity侧边栏的方式,侧边栏的每一项对应一个Fragment,要实现不同的Fragment动态显示与隐藏ActionBar Me ...

  9. 完美解决ListView 与 ScrollView 共存问题

    1:首先设置ListView的高度,在setAdapter之后调用此方法. public static void setListViewHeightBasedOnChildren(ListView l ...

  10. 使用ownCloud搭建你的个人云服务(ubuntu 14.04 server)(ownCloud对文件不切片,Seafile对文件切片),owncloud没有存储的功能 只能同步 本地删除了服务器也会删除

    ownCloud是什么 ownCloud是一个自由且开源的个人云存储解决方案(类似百度网盘或者Dropbox),包括两个部分:服务器和客户端. ownCloud在客户端可通过网页界面,或者安装专用的客 ...