Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NIFTy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ift
NIFTy
Commits
21053a6b
Commit
21053a6b
authored
5 years ago
by
Philipp Arras
Browse files
Options
Downloads
Patches
Plain Diff
Remove output of new AbsDeltaIC to files for now
parent
53eb3379
No related branches found
No related tags found
1 merge request
!341
Add AbsDeltaEnergyController to NIFTy
Pipeline
#60262
passed
5 years ago
Stage: build_docker
Stage: test
Stage: demo_runs
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nifty5/minimization/iteration_controllers.py
+3
-9
3 additions, 9 deletions
nifty5/minimization/iteration_controllers.py
with
3 additions
and
9 deletions
nifty5/minimization/iteration_controllers.py
+
3
−
9
View file @
21053a6b
...
@@ -15,10 +15,10 @@
...
@@ -15,10 +15,10 @@
#
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
import
numpy
as
np
from
..logger
import
logger
from
..logger
import
logger
from
..utilities
import
NiftyMeta
from
..utilities
import
NiftyMeta
import
numpy
as
np
from
time
import
time
class
IterationController
(
metaclass
=
NiftyMeta
):
class
IterationController
(
metaclass
=
NiftyMeta
):
...
@@ -289,12 +289,11 @@ class AbsDeltaEnergyController(IterationController):
...
@@ -289,12 +289,11 @@ class AbsDeltaEnergyController(IterationController):
"""
"""
def
__init__
(
self
,
deltaE
,
convergence_level
=
1
,
iteration_limit
=
None
,
def
__init__
(
self
,
deltaE
,
convergence_level
=
1
,
iteration_limit
=
None
,
name
=
None
,
file_
name
=
None
):
name
=
None
):
self
.
_deltaE
=
deltaE
self
.
_deltaE
=
deltaE
self
.
_convergence_level
=
convergence_level
self
.
_convergence_level
=
convergence_level
self
.
_iteration_limit
=
iteration_limit
self
.
_iteration_limit
=
iteration_limit
self
.
_name
=
name
self
.
_name
=
name
self
.
_file_name
=
file_name
def
start
(
self
,
energy
):
def
start
(
self
,
energy
):
self
.
_itcount
=
-
1
self
.
_itcount
=
-
1
...
@@ -334,9 +333,4 @@ class AbsDeltaEnergyController(IterationController):
...
@@ -334,9 +333,4 @@ class AbsDeltaEnergyController(IterationController):
if
self
.
_ccount
>=
self
.
_convergence_level
:
if
self
.
_ccount
>=
self
.
_convergence_level
:
return
self
.
CONVERGED
return
self
.
CONVERGED
# Write energy to file
if
self
.
_file_name
is
not
None
:
with
open
(
self
.
_file_name
,
'
a+
'
)
as
f
:
f
.
write
(
'
{} {} {}
\n
'
.
format
(
time
(),
energy
.
value
,
diff
))
return
self
.
CONTINUE
return
self
.
CONTINUE
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