Spark MLlib Deep Learning Deep Belief Network (深度学习-深度信念网络)2.3
Spark MLlib Deep Learning Deep Belief Network (深度学习-深度信念网络)2.3
第二章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))
转载请注明出处:
Spark MLlib Deep Learning Deep Belief Network (深度学习-深度信念网络)2.3的更多相关文章
- 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 ...
- Spark MLlib Deep Learning Deep Belief Network (深度学习-深度信念网络)2.2
Spark MLlib Deep Learning Deep Belief Network (深度学习-深度信念网络)2.2 http://blog.csdn.net/sunbow0 第二章Deep ...
- Spark MLlib Deep Learning Convolution Neural Network (深度学习-卷积神经网络)3.1
3.Spark MLlib Deep Learning Convolution Neural Network (深度学习-卷积神经网络)3.1 http://blog.csdn.net/sunbow0 ...
- Spark MLlib Deep Learning Convolution Neural Network (深度学习-卷积神经网络)3.2
3.Spark MLlib Deep Learning Convolution Neural Network(深度学习-卷积神经网络)3.2 http://blog.csdn.net/sunbow0 ...
- Spark MLlib Deep Learning Convolution Neural Network (深度学习-卷积神经网络)3.3
3.Spark MLlib Deep Learning Convolution Neural Network(深度学习-卷积神经网络)3.3 http://blog.csdn.net/sunbow0 ...
- 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的简单理解 ...
- 调参侠的末日? Auto-Keras 自动搜索深度学习模型的网络架构和超参数
Auto-Keras 是一个开源的自动机器学习库.Auto-Keras 的终极目标是允许所有领域的只需要很少的数据科学或者机器学习背景的专家都可以很容易的使用深度学习.Auto-Keras 提供了一系 ...
- 深度学习图像分割——U-net网络
写在前面: 一直没有整理的习惯,导致很多东西会有所遗忘,遗漏.借着这个机会,养成一个习惯. 对现有东西做一个整理.记录,对新事物去探索.分享. 因此博客主要内容为我做过的,所学的整理记录以及新的算法. ...
- 深度学习|基于LSTM网络的黄金期货价格预测--转载
深度学习|基于LSTM网络的黄金期货价格预测 前些天看到一位大佬的深度学习的推文,内容很适用于实战,争得原作者转载同意后,转发给大家.之后会介绍LSTM的理论知识. 我把code先放在我github上 ...
随机推荐
- UVA 10400 Game Show Math (dfs + 记忆化搜索)
Problem H Game Show Math Input: standard input Output: standard output Time Limit: 15 seconds A game ...
- HashMap的存储结构及原理
1.HashMap的数据结构(HashMap通过hashcode对其内容进行高速查找,是无序的) 数据结构中有数组和链表来实现对数据的存储,但这两者基本上是两个极端. 数组 :数组的存储区是连续的,占 ...
- [Redux] Passing the Store Down Implicitly via Context
We have to write a lot of boiler plate code to pass this chore down as a prop. But there is another ...
- Network 20Q--Q2 How does Google sell ad spaces?
在使用Google搜索的时候会发现,搜索出来的页面除了在左边显示搜索结果以外,还会页面的右边推荐一些广告.那么Google是怎么从这些广告挣钱以及广告商可以通过Google广告获得什么利益呢? Goo ...
- 页面全部加载完毕和页面dom树加载完毕
dom树加载完毕 $(document).ready()//原生写法document.ready = function (callback) { ///兼容FF,Google ...
- AVL树插入和删除
一.AVL树简介 AVL树是一种平衡的二叉查找树. 平衡二叉树(AVL 树)是一棵空树,或者是具有下列性质的二叉排序树: 1它的左子树和右子树都是平衡二叉树, 2且左子树和右子树高度之差的 ...
- EMCA常用命令 【weber整理必出精品】
EMCA常用命令 创建一个EM资料库 emca -repos create 重建一个EM资料库 emca -repos recreate 删除一个EM资料库 emca -repos drop 配置数据 ...
- NSArray使用小结
http://blog.csdn.net/ms2146/article/details/8654263
- UI基础视图----UIWebView总结
UIWebView是UIKit框架中继承于UIView的一个常用的基础视图,和UILabel,UIImageView是兄弟类,用于展示一个网页. UIWebView是一个可以设置代理的类,在加载的不同 ...
- Oracle 账户被锁定
哎 每次安装oracle的时候总是忘了将用户解锁,结果就蛋疼了,从网上找到一个简单的解决方案 在CMD命令输出如下: sqlplus /nolog alert user system account ...