|
def | __init__ (self, options, tgt_opts, forcefield) |
|
def | submit_jobs (self, mvals, AGrad=False, AHess=False) |
|
def | read (self, mvals, AGrad=False, AHess=False) |
|
def | get (self, mvals, AGrad=False, AHess=False) |
|
def | indicate (self) |
|
def | get_X (self, mvals=None, customdir=None) |
| Computes the objective function contribution without any parametric derivatives. More...
|
|
def | read_0grads (self) |
| Read a file from the target directory containing names of parameters that don't contribute to the gradient. More...
|
|
def | write_0grads (self, Ans) |
| Write a file to the target directory containing names of parameters that don't contribute to the gradient. More...
|
|
def | get_G (self, mvals=None, customdir=None) |
| Computes the objective function contribution and its gradient. More...
|
|
def | get_H (self, mvals=None, customdir=None) |
| Computes the objective function contribution and its gradient / Hessian. More...
|
|
def | link_from_tempdir (self, absdestdir) |
|
def | refresh_temp_directory (self) |
| Back up the temporary directory if desired, delete it and then create a new one. More...
|
|
def | check_files (self, there) |
| Check this directory for the presence of readable files when the 'read' option is set. More...
|
|
def | absrd (self, inum=None) |
| Supply the correct directory specified by user's "read" option. More...
|
|
def | maxrd (self) |
| Supply the latest existing temp-directory containing valid data. More...
|
|
def | maxid (self) |
| Supply the latest existing temp-directory. More...
|
|
def | meta_indicate (self, customdir=None) |
| Wrap around the indicate function, so it can print to screen and also to a file. More...
|
|
def | meta_get (self, mvals, AGrad=False, AHess=False, customdir=None) |
| Wrapper around the get function. More...
|
|
def | stage (self, mvals, AGrad=False, AHess=False, customdir=None, firstIteration=False) |
| Stages the directory for the target, and then launches Work Queue processes if any. More...
|
|
def | wq_complete (self) |
| This method determines whether the Work Queue tasks for the current target have completed. More...
|
|
def | printcool_table (self, data=OrderedDict([]), headings=[], banner=None, footnote=None, color=0) |
| Print target information in an organized table format. More...
|
|
def | serialize_ff (self, mvals, outside=None) |
| This code writes a force field pickle file to an folder in "job.tmp/dnm/forcebalance.p", because it takes time to compress and most targets can simply reuse this file. More...
|
|
Definition at line 778 of file target.py.
def src.target.Target.get_G |
( |
|
self, |
|
|
|
mvals = None , |
|
|
|
customdir = None |
|
) |
| |
|
inherited |
Computes the objective function contribution and its gradient.
First the low-level 'get' method is called with the analytic gradient switch turned on. Then we loop through the fd1_pids and compute the corresponding elements of the gradient by finite difference, if the 'fdgrad' switch is turned on. Alternately we can compute the gradient elements and diagonal Hessian elements at the same time using central difference if 'fdhessdiag' is turned on.
In this function we also record which parameters cause a nonzero change in the objective function contribution. Parameters which do not change the objective function will not be differentiated in subsequent calculations. This is recorded in a text file in the targets directory.
Definition at line 301 of file target.py.
def src.target.Target.get_H |
( |
|
self, |
|
|
|
mvals = None , |
|
|
|
customdir = None |
|
) |
| |
|
inherited |
Computes the objective function contribution and its gradient / Hessian.
First the low-level 'get' method is called with the analytic gradient and Hessian both turned on. Then we loop through the fd1_pids and compute the corresponding elements of the gradient by finite difference, if the 'fdgrad' switch is turned on.
This is followed by looping through the fd2_pids and computing the corresponding Hessian elements by finite difference. Forward finite difference is used throughout for the sake of speed.
Definition at line 326 of file target.py.
def src.target.Target.read_0grads |
( |
|
self | ) |
|
|
inherited |
Read a file from the target directory containing names of parameters that don't contribute to the gradient.
Note that we are checking the derivatives of the objective function, and not the derivatives of the quantities that go into building the objective function. However, it is the quantities that we actually differentiate. Since there is a simple chain rule relationship, the parameters that do/don't contribute to the objective function/quantities are the same.
However, property gradients do contribute to objective function Hessian elements, so we cannot use the same mechanism for excluding the calculation of property Hessians. This is mostly fine since we rarely if ever calculate an explicit property Hessian.
Definition at line 226 of file target.py.
self.tempdir = os.path.join('temp',self.name) The directory in which the simulation is running - this can be updated.
Directory of the current iteration; if not None, then the simulation runs under temp/target_name/iteration_number The 'customdir' is customizable and can go below anything.
Not expecting more than ten thousand iterations Go into the directory where get() will be executed. Write mathematical parameters to file; will be used to checkpoint calculation. Read in file that specifies which derivatives may be skipped.
Definition at line 166 of file target.py.