Skip to content
Snippets Groups Projects
Commit e28a43b1 authored by Laura Christine Kühle's avatar Laura Christine Kühle
Browse files

Improved calculation of random point for stencil.

parent f394a4cb
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,7 @@ TODO: Remove unnecessary lines -> Done ...@@ -15,6 +15,7 @@ TODO: Remove unnecessary lines -> Done
TODO: Fix bug in 'input_data' calculation -> Done TODO: Fix bug in 'input_data' calculation -> Done
TODO: Change order of imports -> Done TODO: Change order of imports -> Done
TODO: Improve calculation of normalization -> Done TODO: Improve calculation of normalization -> Done
TODO: Improve calculation of random point for stencil -> Done
""" """
...@@ -245,7 +246,7 @@ class TrainingDataGenerator(object): ...@@ -245,7 +246,7 @@ class TrainingDataGenerator(object):
grid_spacing = 2 / (2 ** np.random.randint(3, high=9, size=1)) grid_spacing = 2 / (2 ** np.random.randint(3, high=9, size=1))
# Pick random point between left and right bound # 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 # Adjust grid spacing if necessary for stencil creation
while point - self._stencil_length/2 * grid_spacing < self._left_bound\ while point - self._stencil_length/2 * grid_spacing < self._left_bound\
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment