如何构造多数据集格式来训练deeplearning4j中的computationgraph?

uqjltbpv  于 2021-05-29  发布在  Spark
关注(0)|答案(0)|浏览(212)

计算图如下:

val conf = new NeuralNetConfiguration.Builder()
  .seed(12345)
  .optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)
  .iterations(1)
  .activation(Activation.LEAKYRELU)
  .weightInit(WeightInit.XAVIER)
  .learningRate(0.01)
  .updater(Updater.NESTEROVS).momentum(0.9)
  .regularization(true).l2(1e-4)
  .graphBuilder()
  .addInputs("userid","weekday","hour","isworkday")
  .addLayer("L1", new EmbeddingLayer.Builder().nOut(512).activation(Activation.IDENTITY).build(),"ip")
  .addVertex("merge",new MergeVertex(), "L1", "adid","appid","createtype","height","width","weekday","hour","isworkday")
  .addLayer("L2", new DenseLayer.Builder().nOut(10).build,"merge")
  .addLayer("out", new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD)
  .activation(Activation.SOFTMAX)
  .nIn(10).nOut(1).build,"L2")
  .setOutputs("out")

如何构建 multidataset 从sparkDataframe数据深度学习4j中训练计算图的数据格式“工作日”,“小时”,“isworkday”通过onehot编码器功能,“userid”通过嵌入功能。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题