public class FileIO extends Object
Modifier and Type | Field and Description |
---|---|
static String |
NETWORK_FILE_EXT |
Modifier and Type | Method and Description |
---|---|
static ConvolutionalNetwork |
createConvolutionalNetworkFromJson(org.json.JSONObject jsonObj) |
static FeedForwardNetwork |
createFeedForwardNetworkFromJson(org.json.JSONObject jsonObj) |
static NeuralNetwork |
createFromFile(File file) |
static <T> T |
createFromFile(File file,
Class<T> clazz) |
static <T> T |
createFromFile(String fileName,
Class<T> clazz) |
static NeuralNetwork |
createFromJson(File file) |
static NeuralNetwork |
createFromJson(org.json.JSONObject jsonObj) |
static NeuralNetwork |
createFromJson(String jsonStr) |
static String |
toJson(NeuralNetwork<?> nnet)
Returns JSON representation of specified neural network object.
|
static void |
writeToFile(NeuralNetwork neuralNet,
String fileName)
Serializes specified neural network to file with specified file.
|
static void |
writeToFileAsJson(NeuralNetwork neuralNet,
String fileName) |
public static final String NETWORK_FILE_EXT
public static void writeToFile(NeuralNetwork neuralNet, String fileName) throws IOException
neuralNet
- neural network to savefileName
- name of the fileIOException
- if something goes wrongpublic static void writeToFileAsJson(NeuralNetwork neuralNet, String fileName) throws IOException
IOException
public static <T> T createFromFile(String fileName, Class<T> clazz) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static <T> T createFromFile(File file, Class<T> clazz) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static NeuralNetwork createFromFile(File file) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static String toJson(NeuralNetwork<?> nnet)
nnet
- public static NeuralNetwork createFromJson(String jsonStr)
public static NeuralNetwork createFromJson(File file) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public static NeuralNetwork createFromJson(org.json.JSONObject jsonObj)
public static ConvolutionalNetwork createConvolutionalNetworkFromJson(org.json.JSONObject jsonObj)
public static FeedForwardNetwork createFeedForwardNetworkFromJson(org.json.JSONObject jsonObj)
Copyright © 2022. All rights reserved.