Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Troubled Cell Detection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Laura Christine Kühle
Troubled Cell Detection
Commits
65d1c41e
Commit
65d1c41e
authored
3 years ago
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Improved comments.
parent
88873b0c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ANN_Data_Generator.py
+5
-4
5 additions, 4 deletions
ANN_Data_Generator.py
with
5 additions
and
4 deletions
ANN_Data_Generator.py
+
5
−
4
View file @
65d1c41e
...
@@ -10,6 +10,7 @@ TODO: Change order of methods -> Done
...
@@ -10,6 +10,7 @@ TODO: Change order of methods -> Done
TODO: Fix bug in initialization of input matrix -> Done
TODO: Fix bug in initialization of input matrix -> Done
TODO: Improve function selection (more even distribution) -> Done
TODO: Improve function selection (more even distribution) -> Done
TODO: Add documentation -> Done
TODO: Add documentation -> Done
TODO: Improve comments -> Done
"""
"""
...
@@ -240,18 +241,18 @@ class TrainingDataGenerator(object):
...
@@ -240,18 +241,18 @@ class TrainingDataGenerator(object):
# Calculating Corresponding Legendre Basis Coefficients for given polynomial_degree
# Calculating Corresponding Legendre Basis Coefficients for given polynomial_degree
# Create stencil and basis_coefficients for smooth_function mapped onto stencil
# Create stencil and basis_coefficients for smooth_function mapped onto stencil
#
Determining grid_spacing
#
Select random cell length
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
a R
andom point between
the
left and right bound
# Pick
r
andom point between left and right bound
point
=
np
.
random
.
random
(
1
)
*
(
self
.
_right_bound
-
self
.
_left_bound
)
+
self
.
_left_bound
point
=
np
.
random
.
random
(
1
)
*
(
self
.
_right_bound
-
self
.
_left_bound
)
+
self
.
_left_bound
#
Ensure Bounds of x-point
stencil
a
re
within the left and right bound
#
Adjust grid spacing if necessary for
stencil
c
re
ation
while
point
-
self
.
_stencil_length
/
2
*
grid_spacing
<
self
.
_left_bound
\
while
point
-
self
.
_stencil_length
/
2
*
grid_spacing
<
self
.
_left_bound
\
or
point
+
self
.
_stencil_length
/
2
*
grid_spacing
>
self
.
_right_bound
:
or
point
+
self
.
_stencil_length
/
2
*
grid_spacing
>
self
.
_right_bound
:
grid_spacing
=
grid_spacing
/
2
grid_spacing
=
grid_spacing
/
2
# x-point stencil
#
Build
x-point stencil
interval
=
np
.
array
([
point
-
self
.
_stencil_length
/
2
*
grid_spacing
,
interval
=
np
.
array
([
point
-
self
.
_stencil_length
/
2
*
grid_spacing
,
point
+
self
.
_stencil_length
/
2
*
grid_spacing
])
point
+
self
.
_stencil_length
/
2
*
grid_spacing
])
stencil
=
np
.
array
([
point
+
factor
*
grid_spacing
stencil
=
np
.
array
([
point
+
factor
*
grid_spacing
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment