From b0b89d44c20e4aca25108e11f05d5936cd695cce Mon Sep 17 00:00:00 2001
From: Antonio Andriella <aandriella@iri.upc.edu>
Date: Mon, 21 Sep 2020 22:59:35 +0200
Subject: [PATCH] add function to get statistics from saved variables

---
 utils.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/utils.py b/utils.py
index b45c9bc..02e21cd 100644
--- a/utils.py
+++ b/utils.py
@@ -1,6 +1,6 @@
 import numpy as np
 import matplotlib.pyplot as plt
-
+import pickle
 
 def plot2D_game_performance(save_path, n_episodes, *y):
     # The position of the bars on the x-axis
@@ -81,4 +81,10 @@ def plot2D_feedback(save_path, n_episodes, *y):
     plt.xticks(r, x, fontweight='bold')
     plt.ylabel("feedback")
     plt.savefig(save_path)
-    plt.show()
\ No newline at end of file
+    plt.show()
+
+def read_user_statistics_from_pickle(file_name):
+    # Getting back the objects:
+    with open(file_name, 'rb') as handle:
+        bn_dict_vars = pickle.load(handle)
+    return bn_dict_vars
\ No newline at end of file
-- 
GitLab