Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
paper-2024-finetuning-greedy-kernel-models
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Wenzel, Tizian
paper-2024-finetuning-greedy-kernel-models
Commits
01130da2
Commit
01130da2
authored
1 year ago
by
Wenzel, Tizian
Browse files
Options
Downloads
Patches
Plain Diff
Minor updates (some fixes).
parent
a3ff177b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
main_03a_func_approx_high.py
+1
-3
1 addition, 3 deletions
main_03a_func_approx_high.py
utilities/kea6.py
+2
-2
2 additions, 2 deletions
utilities/kea6.py
with
3 additions
and
5 deletions
main_03a_func_approx_high.py
+
1
−
3
View file @
01130da2
...
...
@@ -20,7 +20,7 @@ np.random.seed(1)
# Settings
N_flexibility
=
0
list_idx_dataset
=
[
0
,
1
,
2
,
3
,
4
,
5
,
7
,
8
,
9
]
list_idx_dataset
=
[
4
,
5
]
list_kernels
=
[
kernels
.
Matern
(
k
=
k_mat
,
flag_normalize_x
=
True
)
for
k_mat
in
range
(
5
)]
list_tkernels
=
[
tkernels
.
Matern
(
k
=
k_mat
,
flag_normalize_x
=
True
)
for
k_mat
in
range
(
5
)]
...
...
@@ -57,8 +57,6 @@ for idx_dataset in list_idx_dataset:
X_train
,
X_test
=
np
.
random
.
rand
(
10000
,
dim
),
np
.
random
.
rand
(
10000
,
dim
)
y_train
,
y_test
=
f_func
(
X_train
),
f_func
(
X_test
)
X_train
,
X_test
,
y_train
,
y_test
=
train_test_split
(
X
,
y
,
test_size
=
0.3
,
random_state
=
2
)
else
:
continue
...
...
This diff is collapsed.
Click to expand it.
utilities/kea6.py
+
2
−
2
View file @
01130da2
...
...
@@ -152,7 +152,7 @@ class KEA(BaseEstimator):
indI
=
list
(
indices_inverse
[:
X_ctrs
.
shape
[
0
]
-
N_flexibility
])
# remove N_flexibility additional centers
# Introduce a suitable ordering into indI to save computational time later on
model_greedy
=
VKOGA_2L
(
kernel
=
self
.
kernel
,
beta
=
self
.
beta
,
verbose
=
False
,
model_greedy
=
VKOGA_2L
(
kernel
=
self
.
kernel
,
greedy_type
=
'
f_greedy
'
,
verbose
=
False
,
tol_p
=
1e-12
,
tol_f
=
1e-12
)
_
=
model_greedy
.
fit
(
X
[
indI
,
:],
y
[
indI
,
:],
maxIter
=
len
(
indI
))
...
...
@@ -236,7 +236,7 @@ class KEA(BaseEstimator):
# Add the N_flexibility many centers again
model_final_add
=
VKOGA_2L
(
kernel
=
self
.
kernel
,
beta
=
self
.
beta
,
verbose
=
False
,
tol_f
=
1e-14
,
tol_p
=
1e-14
)
model_final_add
=
VKOGA_2L
(
kernel
=
self
.
kernel
,
greedy_type
=
'
f_greedy
'
,
verbose
=
False
,
tol_f
=
1e-14
,
tol_p
=
1e-14
)
model_final_add
.
fit
(
X
[
indI
,
:],
y
[
indI
,
:],
maxIter
=
len
(
indI
))
# use the existing centers
indI
=
[
indI
[
idx
]
for
idx
in
model_final_add
.
indI_
]
notIndI
=
[
idx
for
idx
in
range
(
X
.
shape
[
0
])
if
idx
not
in
indI
]
# required because vkoga removes previously chosen points
...
...
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