Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
Quantum Support Vector Regression
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sdlrs
Quantum Support Vector Regression
Commits
28ac52a9
Commit
28ac52a9
authored
Jul 8, 2022
by
Edoardo Pasetto
Browse files
Options
Downloads
Patches
Plain Diff
Delete meris.py
parent
c4b5af00
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
GRSL/MERIS_dataset_generation/meris.py
+0
-91
0 additions, 91 deletions
GRSL/MERIS_dataset_generation/meris.py
with
0 additions
and
91 deletions
GRSL/MERIS_dataset_generation/meris.py
deleted
100644 → 0
+
0
−
91
View file @
c4b5af00
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 23 10:41:37 2022
@author: Utente
"""
import
numpy
as
np
import
os
os
.
chdir
(
'
C:
\\
Users
\\
Utente
\\
Desktop
\\
Julich
\\
Synthetic
\\
MERIS
'
)
import
library
as
lib
#mu and sigmas refer to the underlying normal distribution, not the distribution itself
wl_array
=
[
412.5
,
442.5
,
490
,
510
,
560
,
620
,
665
,
681.25
]
n_samples
=
630
C_mu
=-
0.86
X_mu
=-
1.21
Y_mu
=-
1.75
C_sigma
=
0.3
X_sigma
=
0.3
Y_sigma
=
0.3
corr_CX
=
0.8
corr_CY
=
0.8
##########################################à
mu
=
np
.
array
([
C_mu
,
X_mu
,
Y_mu
])
cov
=
np
.
zeros
((
len
(
mu
),
len
(
mu
)))
# for i in range(len(mu)):
# cov[i,i]=mu[i]
cov
[
0
,
0
]
=
C_sigma
cov
[
1
,
1
]
=
X_sigma
cov
[
2
,
2
]
=
Y_sigma
cov_CX
=
corr_CX
*
C_sigma
*
X_sigma
cov_CY
=
corr_CY
*
C_sigma
*
Y_sigma
#######################################
cov
[
0
,
1
]
=
cov_CX
cov
[
1
,
0
]
=
cov_CX
cov
[
0
,
2
]
=
cov_CY
cov
[
2
,
0
]
=
cov_CY
###################################
generator
=
np
.
random
.
default_rng
()
samples
=
generator
.
multivariate_normal
(
mean
=
mu
,
cov
=
cov
,
size
=
n_samples
)
#samples_a=np.random.multivariate_normal(mean=mu,cov=cov,size=n_samples)
oap
=
np
.
exp
(
samples
)
#%%
################################
R
=
np
.
zeros
((
oap
.
shape
[
0
],
len
(
wl_array
)))
for
i
in
range
(
R
.
shape
[
0
]):
C
,
X
,
Y
=
oap
[
i
,:]
R
[
i
,:]
=
lib
.
get_reflectance_vector
(
wl_array
,
C
,
X
,
Y
)
##############################
#remember to convert to apply the logarithm the dataset!!
C_array
=
oap
[:,
0
]
save_path
=
'
C:
\\
Users
\\
Utente
\\
Desktop
\\
Julich
\\
Synthetic
\\
MERIS\dataset
\\
'
np
.
save
(
save_path
+
'
target.npy
'
,
C_array
)
np
.
save
(
save_path
+
'
input.npy
'
,
R
)
np
.
save
(
save_path
+
'
oap.npy
'
,
oap
)
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