我正在编写使用CNN进行句子分类的示例代码。我已经训练过ComputationGraph
,并将其保存到磁盘上。将来在加载网络时,如何从要分类的句子中创建INDArray
对象?
ComputationGraph net = ModelSerializer.restoreComputationGraph("My model");
String sentence = "Test sentence";
// How do I create INDArray?
INDArray array = ????????;
INDArray results = net.outputSingle(array);