minimizers class#

class pycif.utils.classes.minimizers.Minimizer(plg_orig=None, orig_name='', **kwargs)[source]#

Bases: Plugin

Plugin type for minimisation algorithms used in variational inversion.

Drives the iterative optimisation loop (e.g. L-BFGS-B, CG) that minimises the cost function with respect to the control vector.

Concrete implementations live in pycif/plugins/minimizers/.

initiate_template()[source]#

Initialise the Minimizer plugin template.

Loads the registered minimizer module and attaches minimize as a bound method on this instance.

classmethod register_plugin(name, version, module, subtype='', **kwargs)[source]#

Register a module for a plugin and version with possibly options

Parameters:
  • name (str) – name of the plugin

  • version (str) – version of the plugin

  • module (types.ModuleType) – module defining the interface between pyCIF and the plugin

  • plugin_type (str) – type of plugin

  • **kwargs (dictionary) – default options for module

minimize(*args, **kwargs)[source]#

Run the minimisation algorithm. Must be overridden.

Raises:

PluginError – Always, in this default implementation.