List of usage examples for org.deeplearning4j.nn.conf NeuralNetConfiguration toJson
public String toJson()
From source file:org.knime.ext.dl4j.base.util.DLModelPortObjectUtils.java
License:Open Source License
/** * Converts layers to list of Strings in json format. * * @param layers the list of layers to convert * @return the list of converted layers to json *//*from w ww . ja v a 2 s.c o m*/ public static List<String> convertLayersToJSONs(final List<Layer> layers) { final List<String> allLayersAsJson = new ArrayList<>(); final NeuralNetConfiguration config = new NeuralNetConfiguration(); for (final Layer layer : layers) { config.setLayer(layer); allLayersAsJson.add(config.toJson()); } return allLayersAsJson; }