November 2019
Intermediate to advanced
304 pages
8h 40m
English
In step 1, we defined a graph vertex input as the following after calling the graphBuilder() method:
builder.addInputs("trainFeatures");
By calling graphBuilder(), we are actually constructing a graph builder to create a computation graph configuration.
Once the LSTM layers are added into the ComputationGraph configuration in step 3, they will act as input layers in the ComputationGraph configuration. We pass the previously mentioned graph vertex input (trainFeatures) to our LSTM layer, as follows:
builder.addLayer("L1", new LSTM.Builder() .nIn(INPUTS) .nOut(LSTM_LAYER_SIZE) .forgetGateBiasInit(1) .activation(Activation.TANH) .build(),"trainFeatures");
The last attribute, trainFeatures, refers to the graph vertex input. Here, ...