Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tom Rink
python
Commits
5b94b998
Commit
5b94b998
authored
3 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
minor changes to run_evaluate_static
parent
1aea9a0f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/deeplearning/icing_cnn.py
+7
-9
7 additions, 9 deletions
modules/deeplearning/icing_cnn.py
with
7 additions
and
9 deletions
modules/deeplearning/icing_cnn.py
+
7
−
9
View file @
5b94b998
...
...
@@ -1103,7 +1103,7 @@ def run_evaluate_static_avg(data_dct, ll, cc, ckpt_dir_s_path, day_night='DAY',
return
ice_lons
,
ice_lats
,
preds_2d
def
run_evaluate_static
(
data_dct
,
num_
lines
,
num_e
le
m
s
,
ckpt_dir_s_path
,
day_night
=
'
DAY
'
,
prob_thresh
=
0.5
,
def
run_evaluate_static
(
data_dct
,
num_
ti
les
,
ckpt_dir_s_path
,
day_night
=
'
DAY
'
,
prob_thresh
=
0.5
,
flight_levels
=
[
0
,
1
,
2
,
3
,
4
],
use_flight_altitude
=
False
):
ckpt_dir_s
=
os
.
listdir
(
ckpt_dir_s_path
)
...
...
@@ -1112,13 +1112,13 @@ def run_evaluate_static(data_dct, num_lines, num_elems, ckpt_dir_s_path, day_nig
if
not
use_flight_altitude
:
flight_levels
=
[
0
]
probs_
2d_
dct
=
{
flvl
:
None
for
flvl
in
flight_levels
}
preds_
2d_
dct
=
{
flvl
:
None
for
flvl
in
flight_levels
}
probs_dct
=
{
flvl
:
None
for
flvl
in
flight_levels
}
preds_dct
=
{
flvl
:
None
for
flvl
in
flight_levels
}
for
flvl
in
flight_levels
:
nn
=
IcingIntensityNN
(
day_night
=
day_night
,
use_flight_altitude
=
use_flight_altitude
)
nn
.
flight_level
=
flvl
nn
.
setup_eval_pipeline
(
data_dct
,
num_
lines
*
num_e
le
m
s
)
nn
.
setup_eval_pipeline
(
data_dct
,
num_
ti
les
)
nn
.
build_model
()
nn
.
build_training
()
nn
.
build_evaluation
()
...
...
@@ -1129,13 +1129,11 @@ def run_evaluate_static(data_dct, num_lines, num_elems, ckpt_dir_s_path, day_nig
preds
=
np
.
where
(
probs
>
prob_thresh
,
1
,
0
)
else
:
preds
=
np
.
argmax
(
probs
,
axis
=
1
)
preds_2d
=
preds
.
reshape
((
num_lines
,
num_elems
))
probs_2d
=
probs
.
reshape
((
num_lines
,
num_elems
))
probs_
2d_
dct
[
flvl
]
=
probs
_2d
preds_
2d_
dct
[
flvl
]
=
preds
_2d
probs_dct
[
flvl
]
=
probs
preds_dct
[
flvl
]
=
preds
return
preds_
2d_
dct
,
probs_
2d_
dct
return
preds_dct
,
probs_dct
if
__name__
==
"
__main__
"
:
...
...
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