Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
253dbfd8
Unverified
Commit
253dbfd8
authored
Jan 17, 2022
by
Yuge Zhang
Committed by
GitHub
Jan 17, 2022
Browse files
Fix SVD error for `numpy >= 1.21` in DNGO (#4466)
parent
a8c12fb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
nni/algorithms/hpo/dngo_tuner.py
nni/algorithms/hpo/dngo_tuner.py
+5
-1
No files found.
nni/algorithms/hpo/dngo_tuner.py
View file @
253dbfd8
import
logging
import
logging
import
warnings
import
numpy
as
np
import
numpy
as
np
import
torch
import
torch
...
@@ -112,7 +113,10 @@ class DNGOTuner(Tuner):
...
@@ -112,7 +113,10 @@ class DNGOTuner(Tuner):
x_arr
=
[]
x_arr
=
[]
for
x
in
self
.
x
:
for
x
in
self
.
x
:
x_arr
.
append
([
x
[
k
]
for
k
in
sorted
(
x
.
keys
())])
x_arr
.
append
([
x
[
k
]
for
k
in
sorted
(
x
.
keys
())])
self
.
model
.
train
(
np
.
array
(
x_arr
),
np
.
array
(
self
.
y
),
do_optimize
=
True
)
try
:
self
.
model
.
train
(
np
.
array
(
x_arr
),
np
.
array
(
self
.
y
),
do_optimize
=
True
)
except
np
.
linalg
.
LinAlgError
as
e
:
warnings
.
warn
(
f
'numpy linalg error encountered in DNGO model training:
{
e
}
'
)
self
.
_model_initialized
=
True
self
.
_model_initialized
=
True
def
_get_default_value
(
self
,
value
):
def
_get_default_value
(
self
,
value
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment