Package deepnetts.util
Class FileIO
java.lang.Object
deepnetts.util.FileIO
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
(String jsonStr) static NeuralNetwork
createFromJson
(org.json.JSONObject jsonObj) 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)
-
Field Details
-
NETWORK_FILE_EXT
- See Also:
-
-
Method Details
-
writeToFile
Serializes specified neural network to file with specified file.- Parameters:
neuralNet
- neural network to savefileName
- name of the file- Throws:
IOException
- if something goes wrong
-
writeToFileAsJson
- Throws:
IOException
-
createFromFile
public static <T> T createFromFile(String fileName, Class<T> clazz) throws IOException, ClassNotFoundException - Throws:
IOException
ClassNotFoundException
-
createFromFile
public static <T> T createFromFile(File file, Class<T> clazz) throws IOException, ClassNotFoundException - Throws:
IOException
ClassNotFoundException
-
createFromFile
- Throws:
IOException
ClassNotFoundException
-
toJson
Returns JSON representation of specified neural network object.- Parameters:
nnet
-- Returns:
-
createFromJson
-
createFromJson
- Throws:
FileNotFoundException
IOException
-
createFromJson
-
createConvolutionalNetworkFromJson
-
createFeedForwardNetworkFromJson
-