Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
168f967a
Commit
168f967a
authored
Mar 13, 2018
by
Martin Reinecke
Browse files
warn() -> warning()
parent
d5fe215d
Pipeline
#26055
passed with stage
in 5 minutes and 26 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty4/minimization/line_energy.py
View file @
168f967a
...
...
@@ -96,6 +96,6 @@ class LineEnergy(object):
res
=
self
.
_energy
.
gradient
.
vdot
(
self
.
_line_direction
)
if
abs
(
res
.
imag
)
/
max
(
abs
(
res
.
real
),
1.
)
>
1e-12
:
from
..logger
import
logger
logger
.
warn
(
"directional derivative has non-negligible "
"imaginary part:"
,
res
)
logger
.
warn
ing
(
"directional derivative has non-negligible "
"imaginary part:"
,
res
)
return
res
.
real
nifty4/minimization/line_search_strong_wolfe.py
View file @
168f967a
...
...
@@ -100,7 +100,8 @@ class LineSearchStrongWolfe(LineSearch):
phi_0
=
le_0
.
value
phiprime_0
=
le_0
.
directional_derivative
if
phiprime_0
==
0
:
logger
.
warn
(
"Directional derivative is zero; assuming convergence"
)
logger
.
warning
(
"Directional derivative is zero; assuming convergence"
)
return
energy
,
False
if
phiprime_0
>
0
:
logger
.
error
(
"Error: search direction is not a descent direction"
)
...
...
@@ -149,13 +150,13 @@ class LineSearchStrongWolfe(LineSearch):
# update alphas
alpha0
,
alpha1
=
alpha1
,
min
(
2
*
alpha1
,
maxstepsize
)
if
alpha1
==
maxstepsize
:
logger
.
warn
(
"max step size reached"
)
logger
.
warn
ing
(
"max step size reached"
)
return
le_alpha1
.
energy
,
False
phi_alpha0
=
phi_alpha1
phiprime_alpha0
=
phiprime_alpha1
logger
.
warn
(
"max iterations reached"
)
logger
.
warn
ing
(
"max iterations reached"
)
return
le_alpha1
.
energy
,
False
def
_zoom
(
self
,
alpha_lo
,
alpha_hi
,
phi_0
,
phiprime_0
,
...
...
@@ -252,7 +253,8 @@ class LineSearchStrongWolfe(LineSearch):
phiprime_alphaj
)
else
:
logger
.
warn
(
"The line search algorithm (zoom) did not converge."
)
logger
.
warning
(
"The line search algorithm (zoom) did not converge."
)
return
le_alphaj
.
energy
,
False
def
_cubicmin
(
self
,
a
,
fa
,
fpa
,
b
,
fb
,
c
,
fc
):
...
...
nifty4/sugar.py
View file @
168f967a
...
...
@@ -86,8 +86,8 @@ def power_analyze(field, spaces=None, binbounds=None,
for
sp
in
field
.
domain
:
if
not
sp
.
harmonic
and
not
isinstance
(
sp
,
PowerSpace
):
logger
.
warn
(
"WARNING: Field has a space in `domain` which is "
"neither harmonic nor a PowerSpace."
)
logger
.
warn
ing
(
"WARNING: Field has a space in `domain` which is "
"neither harmonic nor a PowerSpace."
)
spaces
=
utilities
.
parse_spaces
(
spaces
,
len
(
field
.
domain
))
...
...
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