@Override public ElementWiseVertex clone() { return new ElementWiseVertex(op); }
/** * Constructor from parsed Keras layer configuration dictionary. * * @param layerConfig dictionary containing Keras layer configuration * @param enforceTrainingConfig whether to enforce training-related configuration options * @throws InvalidKerasConfigurationException * @throws UnsupportedKerasConfigurationException */ public KerasMerge(Map<String, Object> layerConfig, boolean enforceTrainingConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException { super(layerConfig, enforceTrainingConfig); this.mergeMode = getMergeMode(layerConfig); if (this.mergeMode == null) this.vertex = new MergeVertex(); else this.vertex = new ElementWiseVertex(mergeMode); }
.addLayer(batchName + "2c", new BatchNormalization(), convName + "2c") .addVertex(shortcutName, new ElementWiseVertex(ElementWiseVertex.Op.Add), batchName + "2c", input) .addLayer(convName, new ActivationLayer.Builder().activation(Activation.RELU).build(),
.addVertex(shortcutName, new ElementWiseVertex(ElementWiseVertex.Op.Add), batchName + "2c", batchName + "1") .addLayer(convName, new ActivationLayer.Builder().activation(Activation.RELU).build(),
previousBlock) .addVertex(nameLayer(blockName, "shortcut", i), new ElementWiseVertex(ElementWiseVertex.Op.Add), nameLayer(blockName, "scaling", i), nameLayer(blockName, "shortcut-identity", i));
previousBlock) .addVertex(nameLayer(blockName, "shortcut", i), new ElementWiseVertex(ElementWiseVertex.Op.Add), nameLayer(blockName, "scaling", i), nameLayer(blockName, "shortcut-identity", i));
previousBlock) .addVertex(nameLayer(blockName, "shortcut", i), new ElementWiseVertex(ElementWiseVertex.Op.Add), nameLayer(blockName, "scaling", i), nameLayer(blockName, "shortcut-identity", i));