public void ReadQTableFromJson() { using (StreamReader r = new StreamReader("QTable.json")) { string json = r.ReadToEnd(); double[,,,] temp = JsonConvert.DeserializeObject <double[, , , ]>(json); try { this.QTable = NDArray.FromMultiDimArray <double>(temp); this.QTable.reshape(new int[] { 1 + Convert.ToInt32((double)nBuckets[0]), 1 + Convert.ToInt32((double)nBuckets[1]), 1 + Convert.ToInt32((double)nBuckets[2]), nActions }); Log.Log("Successfuly loaded QTable from json"); } catch (Exception e) { Log.Log("WARNING Mismatch on QTable size stored on Json"); } } }