January 2019
Intermediate to advanced
322 pages
7h 29m
English
Whatever preprocessing strategy (local or Spark) has been chosen, here is how training using Spark happens.
First, you create the SparkContext, set up the TrainingMaster, and build the neural network model using the following instances:
val conf = new SparkConf...val sparkContext = new JavaSparkContext(conf)val trainingMaster = ...val net:ComputationGraph = ...val sparkNet = new SparkComputationGraph(sparkContext, net, trainingMaster)sparkNet.setListeners(new PerformanceListener(10, true))
After this, a data loader needs to be created, as in the following example:
val imageHeightWidth = 64 val imageChannels = 3 val labelMaker = new ParentPathLabelGeneratorval rr = new ImageRecordReader(imageHeightWidth, imageHeightWidth, imageChannels, ...
Read now
Unlock full access