3、Spark MLlib Deep Learning Convolution Neural Network(深度学习-卷积神经网络)3.3
第三章Convolution Neural Network (卷积神经网络)
3实例
3.1 测试数据
按照上例数据,或者新建图片识别数据。
3.2 CNN实例
//2 测试数据
Logger.getRootLogger.setLevel(Level.WARN)
valdata_path="/user/tmp/deeplearn/train_d.txt"
valexamples=sc.textFile(data_path).cache()
valtrain_d1=examples.map{ line =>
valf1 = line.split("\t")
valf =f1.map(f => f.toDouble)
valy =f.slice(0,10)
valx =f.slice(10,f.length)
(newBDM(1,y.length, y), (new BDM(1,