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

Removed option to choose training domain.

parent 00e65c21
No related branches found
No related tags found
No related merge requests found
...@@ -33,22 +33,13 @@ class TrainingDataGenerator: ...@@ -33,22 +33,13 @@ class TrainingDataGenerator:
Builds random training data. Builds random training data.
""" """
def __init__(self, left_bound=-1, right_bound=1): def __init__(self):
"""Initializes TrainingDataGenerator. """Initializes TrainingDataGenerator."""
Parameters
----------
left_bound : float, optional
Left boundary of interval. Default: -1.
right_bound : float, optional
Right boundary of interval. Default: 1.
"""
self._basis_list = [OrthonormalLegendre(pol_deg) self._basis_list = [OrthonormalLegendre(pol_deg)
for pol_deg in range(7)] for pol_deg in range(7)]
self._quadrature_list = [Gauss({'num_nodes': pol_deg+1}) self._quadrature_list = [Gauss({'num_nodes': pol_deg+1})
for pol_deg in range(7)] for pol_deg in range(7)]
self._mesh_list = [Mesh(left_bound=left_bound, right_bound=right_bound, self._mesh_list = [Mesh(left_bound=-1, right_bound=1,
num_ghost_cells=0, num_cells=2**exp) num_ghost_cells=0, num_cells=2**exp)
for exp in range(5, 12)] for exp in range(5, 12)]
......
data_dir: 'Oct03' data_dir: 'Oct04'
random_seed: 1234 random_seed: 1234
# Parameter for Approximation with Troubled Cell Detection # Parameter for Approximation with Troubled Cell Detection
...@@ -49,9 +49,6 @@ Approximation: ...@@ -49,9 +49,6 @@ Approximation:
ANN_Data: ANN_Data:
sample_number: 100 sample_number: 100
left_boundary: -1
right_boundary: 1
smooth_troubled_balance: 0.5 smooth_troubled_balance: 0.5
stencil_length: 3 stencil_length: 3
......
...@@ -17,8 +17,6 @@ rule generate_data: ...@@ -17,8 +17,6 @@ rule generate_data:
protected(DIR+'/output_data.npy') protected(DIR+'/output_data.npy')
default_target: True default_target: True
params: params:
left_bound = config['left_boundary'],
right_bound = config['right_boundary'],
balance = config['smooth_troubled_balance'], balance = config['smooth_troubled_balance'],
stencil_len = config['stencil_length'], stencil_len = config['stencil_length'],
sample_number = config['sample_number'], sample_number = config['sample_number'],
...@@ -37,8 +35,7 @@ rule generate_data: ...@@ -37,8 +35,7 @@ rule generate_data:
with open(str(log), 'w') as logfile: with open(str(log), 'w') as logfile:
sys.stdout = logfile sys.stdout = logfile
generator = ANN_Data_Generator.TrainingDataGenerator( generator = ANN_Data_Generator.TrainingDataGenerator()
left_bound=params.left_bound, right_bound=params.right_bound)
data = generator.build_training_data(balance=params.balance, data = generator.build_training_data(balance=params.balance,
init_cond_list=init_cond_list, directory=DIR, init_cond_list=init_cond_list, directory=DIR,
num_samples=params.sample_number, num_samples=params.sample_number,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment