Graph Vertices
Vertex types for ComputationGraph — Merge, ElementWise, Subset, Stack, Reshape, and custom vertices
MergeVertex
import org.deeplearning4j.nn.graph.vertex.impl.MergeVertex;
ComputationGraphConfiguration conf = new NeuralNetConfiguration.Builder()
.graphBuilder()
.addInputs("input")
// Branch 1: 1x1 convolution
.addLayer("branch1", new ConvolutionLayer.Builder(1, 1)
.nIn(64).nOut(32).build(), "input")
// Branch 2: 3x3 convolution
.addLayer("branch2", new ConvolutionLayer.Builder(3, 3)
.nIn(64).nOut(32).stride(1,1).convolutionMode(ConvolutionMode.Same).build(), "input")
// Concatenate both branches: output has 64 channels
.addVertex("merged", new MergeVertex(), "branch1", "branch2")
.addLayer("output", new CnnLossLayer.Builder().build(), "merged")
.setOutputs("output")
.build();ElementWiseVertex
Operations
Operation constant
Behaviour
SubsetVertex
StackVertex and UnstackVertex
StackVertex
UnstackVertex
ReshapeVertex
L2NormalizeVertex
L2Vertex
ScaleVertex
ShiftVertex
PreprocessorVertex
ReverseTimeSeriesVertex
PoolHelperVertex
Custom Vertices
Last updated
Was this helpful?