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
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
ift
NIFTy
Commits
be1a0818
Commit
be1a0818
authored
Feb 17, 2018
by
Martin Reinecke
Browse files
cosmetics and small tweaks
parent
72670f97
Pipeline
#25064
passed with stages
in 6 minutes and 39 seconds
Changes
19
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty4/domains/domain.py
View file @
be1a0818
...
...
@@ -27,9 +27,6 @@ class Domain(with_metaclass(
"""The abstract class repesenting a (structured or unstructured) domain.
"""
def
__init__
(
self
):
pass
@
abc
.
abstractmethod
def
__repr__
(
self
):
raise
NotImplementedError
...
...
nifty4/domains/structured_domain.py
View file @
be1a0818
...
...
@@ -29,9 +29,6 @@ class StructuredDomain(Domain):
are needed for power spectrum analysis and smoothing.
"""
def
__init__
(
self
):
super
(
StructuredDomain
,
self
).
__init__
()
@
abc
.
abstractproperty
def
scalar_dvol
(
self
):
"""float or None : uniform cell volume, if applicable
...
...
nifty4/library/wiener_filter_energy.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
nifty4/minimization/conjugate_gradient.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
nifty4/minimization/gradient_norm_controller.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
nifty4/minimization/iteration_controller.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
nifty4/minimization/line_search.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
@@ -31,8 +31,8 @@ class LineSearch(with_metaclass(abc.ABCMeta,
minimization process.
"""
def
__init__
(
self
):
self
.
preferred_initial_step_size
=
Non
e
def
__init__
(
self
,
preferred_initial_step_size
=
None
):
self
.
preferred_initial_step_size
=
preferred_initial_step_siz
e
@
abc
.
abstractmethod
def
perform_line_search
(
self
,
energy
,
pk
,
f_k_minus_1
=
None
):
...
...
nifty4/minimization/line_search_strong_wolfe.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
@@ -50,11 +50,12 @@ class LineSearchStrongWolfe(LineSearch):
(Default: 100)
"""
def
__init__
(
self
,
c1
=
1e-4
,
c2
=
0.9
,
def
__init__
(
self
,
preferred_initial_step_size
=
None
,
c1
=
1e-4
,
c2
=
0.9
,
max_step_size
=
1000000000
,
max_iterations
=
100
,
max_zoom_iterations
=
100
):
super
(
LineSearchStrongWolfe
,
self
).
__init__
()
super
(
LineSearchStrongWolfe
,
self
).
__init__
(
preferred_initial_step_size
)
self
.
c1
=
np
.
float
(
c1
)
self
.
c2
=
np
.
float
(
c2
)
...
...
nifty4/minimization/nonlinear_cg.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
nifty4/minimization/quadratic_energy.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
nifty4/minimization/relaxed_newton.py
View file @
be1a0818
...
...
@@ -26,11 +26,12 @@ class RelaxedNewton(DescentMinimizer):
The descent direction is determined by weighting the gradient at the
current parameter position with the inverse local curvature.
"""
def
__init__
(
self
,
controller
,
line_searcher
=
LineSearchStrongWolfe
()):
def
__init__
(
self
,
controller
,
line_searcher
=
None
):
if
line_searcher
is
None
:
line_searcher
=
LineSearchStrongWolfe
(
preferred_initial_step_size
=
1.
)
super
(
RelaxedNewton
,
self
).
__init__
(
controller
=
controller
,
line_searcher
=
line_searcher
)
# FIXME: this does not look idiomatic
self
.
line_searcher
.
preferred_initial_step_size
=
1.
def
get_descent_direction
(
self
,
energy
):
return
-
energy
.
curvature
.
inverse_times
(
energy
.
gradient
)
nifty4/plotting/plot.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
setup.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
test/common.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
test/test_energies/test_power.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
test/test_field.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
test/test_minimization/test_minimizers.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
test/test_operators/test_smoothing_operator.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
test/test_spaces/test_interface.py
View file @
be1a0818
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
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