我有两个ComputationGraph实例:
ComputationGraph encoder = KerasModelImport.importKerasModelAndWeights(
this.getClass().getResource("encoder.h5").getPath(), false);
ComputationGraph classifier = KerasModelImport.importKerasModelAndWeights(
this.getClass().getResource("classifier.h5").getPath());
然后我一个接一个地执行它们:
INDArray input = ....
INDArray encoded = encoder.outputSingle(input)
INDArray output = classifier.outputSingle(encoded)
如何合并两个ComputationGraph实例,所以我可以调用一个:
INDArray result = graph.outputSingle(input)