title: Brain.js - cannot load network from a json file
body: <p>I'm using Brain.js in a node.js project. Training now takes too long to run every time i run the program to update things so i'm saving the network in a json file, using the intended method mentioned in the Github page. it seems to save properly but when i try to load it it says 
  "<strong><em>node_modules/brain/lib/neuralnetwork.js:341
      var size = json.layers.length;</em></strong> " 
  i'm probably doing something wrong as i haven't found this problem on Github or here, any help would be appreciated. not put the entire file as most of it is repeats of code to load in the files. this all works properly not had any errors until loading the file. If more code is required i'll post it</p>
  
  <p>main file </p>
  
  <pre><code>function run(){
      console.log("training network...");
      var trainingNet0 = net0.train([
          {input: pixels0, output: [1]},
          {input: pixels1, output: [1]},
          {input: pixels2, output: [1]},
          {input: pixels3, output: [1]},
          {input: pixels6, output: [0]},
          {input: pixels7, output: [0]},
          {input: pixels8, output: [0]},
          {input: pixels9, output: [0]}],
          {
              errorThresh: 5,  // error threshold to reach
              iterations: 1000,   // maximum training iterations
              log: false,           // console.log() progress periodically
              logPeriod: 10,       // number of iterations between logging
              learningRate: 0.003    // learning rate);
      })
  
      console.log(net0.run(pixels4))
      console.log(net0.run(pixels5))
      console.log(net0.run(pixels6))
      console.log(net0.run(pixels3))
      saveFile();
  
  }
  
  function saveFile(){
      fs.writeFile("network.json", net0.toJSON(), function(err) {
          if(err)
              return console.log(err);
  
          console.log("The file was saved!");
          loadFile()
      });
      console.log(net0.toJSON())
  }
  
  function loadFile(){    
      fs.readFile('network.json', function (err, data) {
          if (err)
              throw err; 
  
          console.log(data.layers);
          net0.fromJSON(data);
          console.log("file loaded");
      });
  }
  </code></pre>
  
  <p>the contents of the json file that is being saved too</p>
  
  <pre><code>[object Object]
  </code></pre>