From e28a43b1b8492d2f72ed6115598c0be1da100f3a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=BChle=2C=20Laura=20Christine=20=28lakue103=29?=
 <laura.kuehle@uni-duesseldorf.de>
Date: Wed, 24 Nov 2021 17:22:58 +0100
Subject: [PATCH] Improved calculation of random point for stencil.

---
 ANN_Data_Generator.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ANN_Data_Generator.py b/ANN_Data_Generator.py
index 73ec3ce..07a7d7c 100644
--- a/ANN_Data_Generator.py
+++ b/ANN_Data_Generator.py
@@ -15,6 +15,7 @@ TODO: Remove unnecessary lines -> Done
 TODO: Fix bug in 'input_data' calculation -> Done
 TODO: Change order of imports -> Done
 TODO: Improve calculation of normalization -> Done
+TODO: Improve calculation of random point for stencil -> Done
 
 """
 
@@ -245,7 +246,7 @@ class TrainingDataGenerator(object):
         grid_spacing = 2 / (2 ** np.random.randint(3, high=9, size=1))
 
         # Pick random point between left and right bound
-        point = np.random.random(1) * (self._right_bound-self._left_bound) + self._left_bound
+        point = np.random.uniform(self._left_bound, self._right_bound)
 
         # Adjust grid spacing if necessary for stencil creation
         while point - self._stencil_length/2 * grid_spacing < self._left_bound\
-- 
GitLab