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
9ceda9ef
Commit
9ceda9ef
authored
2 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
6282f56e
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/cnn_cld_frac_mod_res.py
+12
-10
12 additions, 10 deletions
modules/deeplearning/cnn_cld_frac_mod_res.py
with
12 additions
and
10 deletions
modules/deeplearning/cnn_cld_frac_mod_res.py
+
12
−
10
View file @
9ceda9ef
...
@@ -62,10 +62,11 @@ IMG_DEPTH = 1
...
@@ -62,10 +62,11 @@ IMG_DEPTH = 1
label_param
=
'
cloud_probability
'
label_param
=
'
cloud_probability
'
params
=
[
'
temp_11_0um_nom
'
,
'
refl_0_65um_nom
'
,
label_param
]
params
=
[
'
temp_11_0um_nom
'
,
'
refl_0_65um_nom
'
,
label_param
]
params_i
=
[
'
refl_0_65um_nom
'
,
label_param
]
data_params_half
=
[
'
temp_11_0um_nom
'
]
data_params_half
=
[
'
temp_11_0um_nom
'
]
data_params_full
=
[
'
refl_0_65um_nom
'
]
data_params_full
=
[
'
refl_0_65um_nom
'
]
label_idx
=
params
.
index
(
label_param
)
label_idx
=
params
_i
.
index
(
label_param
)
# label_idx = 0
# label_idx = 0
print
(
'
data_params_half:
'
,
data_params_half
)
print
(
'
data_params_half:
'
,
data_params_half
)
...
@@ -350,7 +351,6 @@ class SRCNN:
...
@@ -350,7 +351,6 @@ class SRCNN:
label_s
.
append
(
nda
)
label_s
.
append
(
nda
)
input_data
=
np
.
concatenate
(
data_s
)
input_data
=
np
.
concatenate
(
data_s
)
input_label
=
np
.
concatenate
(
label_s
)
input_label
=
np
.
concatenate
(
label_s
)
input_label
=
input_label
[:,
0
,
:,
:]
data_norm
=
[]
data_norm
=
[]
for
param
in
data_params_half
:
for
param
in
data_params_half
:
...
@@ -366,8 +366,9 @@ class SRCNN:
...
@@ -366,8 +366,9 @@ class SRCNN:
data_norm
.
append
(
tmp
)
data_norm
.
append
(
tmp
)
for
param
in
data_params_full
:
for
param
in
data_params_full
:
idx
=
params
.
index
(
param
)
idx
=
params_i
.
index
(
param
)
tmp
=
input_data
[:,
idx
,
:,
:]
# tmp = input_data[:, idx, :, :]
tmp
=
input_label
[:,
idx
,
:,
:]
tmp
=
tmp
.
copy
()
tmp
=
tmp
.
copy
()
lo
,
hi
,
std
,
avg
=
get_min_max_std
(
tmp
)
lo
,
hi
,
std
,
avg
=
get_min_max_std
(
tmp
)
...
@@ -381,7 +382,8 @@ class SRCNN:
...
@@ -381,7 +382,8 @@ class SRCNN:
data_norm
.
append
(
avg
[:,
0
:
66
,
0
:
66
])
data_norm
.
append
(
avg
[:,
0
:
66
,
0
:
66
])
# data_norm.append(std[:, 0:66, 0:66])
# data_norm.append(std[:, 0:66, 0:66])
# ---------------------------------------------------
# ---------------------------------------------------
tmp
=
input_data
[:,
label_idx
,
:,
:]
# tmp = input_data[:, label_idx, :, :]
tmp
=
input_data
[:,
2
,
:,
:]
tmp
=
tmp
.
copy
()
tmp
=
tmp
.
copy
()
tmp
=
np
.
where
(
np
.
isnan
(
tmp
),
0
,
tmp
)
tmp
=
np
.
where
(
np
.
isnan
(
tmp
),
0
,
tmp
)
if
DO_ESPCN
:
if
DO_ESPCN
:
...
@@ -399,7 +401,7 @@ class SRCNN:
...
@@ -399,7 +401,7 @@ class SRCNN:
data
=
data
.
astype
(
np
.
float32
)
data
=
data
.
astype
(
np
.
float32
)
# -----------------------------------------------------
# -----------------------------------------------------
# -----------------------------------------------------
# -----------------------------------------------------
label
=
input_label
label
=
input_label
[:,
label_idx
,
:,
:]
label
=
label
.
copy
()
label
=
label
.
copy
()
label
=
label
[:,
y_128
,
x_128
]
label
=
label
[:,
y_128
,
x_128
]
if
NumClasses
==
5
:
if
NumClasses
==
5
:
...
@@ -799,10 +801,10 @@ class SRCNN:
...
@@ -799,10 +801,10 @@ class SRCNN:
return
pred
return
pred
def
run
(
self
,
directory
,
ckpt_dir
=
None
,
num_data_samples
=
50000
):
def
run
(
self
,
directory
,
ckpt_dir
=
None
,
num_data_samples
=
50000
):
train_data_files
=
glob
.
glob
(
directory
+
'
data_
train*.npy
'
)
train_data_files
=
glob
.
glob
(
directory
+
'
train
_mres_
*.npy
'
)
valid_data_files
=
glob
.
glob
(
directory
+
'
data_
valid*.npy
'
)
valid_data_files
=
glob
.
glob
(
directory
+
'
valid
_mres
*.npy
'
)
train_label_files
=
glob
.
glob
(
directory
+
'
label_
train*.npy
'
)
train_label_files
=
glob
.
glob
(
directory
+
'
train
_ires
*.npy
'
)
valid_label_files
=
glob
.
glob
(
directory
+
'
label_valid
*.npy
'
)
valid_label_files
=
glob
.
glob
(
directory
+
'
valid_ires_
*.npy
'
)
self
.
setup_pipeline
(
train_data_files
,
train_label_files
,
valid_data_files
,
valid_label_files
,
num_data_samples
)
self
.
setup_pipeline
(
train_data_files
,
train_label_files
,
valid_data_files
,
valid_label_files
,
num_data_samples
)
# train_data_files = glob.glob(directory+'data_train_*.npy')
# train_data_files = glob.glob(directory+'data_train_*.npy')
...
...
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