How can I embed more than one field in deeplearning4j?
For example, if I want to embed user_id
and ad_id
as two fields:
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)
.list
.layer(0, new EmbeddingLayer.Builder().nIn(FEATURE_DIMS).nOut(512).activation(Activation.IDENTITY).build())
.layer(1, new DenseLayer.Builder().nIn(512).nOut(10).build)
.layer(2, new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD)
.activation(Activation.SOFTMAX)
.nIn(10).nOut(1).build)
.pretrain(false)
.backprop(true)
.build
This code only embeds one field in deeplearning4j. How can I embed more than one at a time?