Module neuroflow::io

source ·
Expand description

The module contains functions, structs, enums, and traits for input/output neural networks. E. g. it can save network to the file and then loads it back.

Example

Saving of neural network:

use neuroflow::FeedForward;
use neuroflow::io;

let mut nn = FeedForward::new(&[2, 2, 1]);
/* train here your neural network */
io::save(&mut nn, "test.flow");

Restoring of neural network:

use neuroflow::FeedForward;
use neuroflow::io;

let mut new_nn: FeedForward = io::load("test.nn")
    .unwrap_or(FeedForward::new(&[2, 2, 1]));

Functions

  • Loads and restores the neural network from file.
  • Saves given neural network to file specified by file_path.
  • Future function for saving in JSON string. return: JSON string