Analysis

Tools for analysis of output exist here.

Module contents

amp.analysis.plot_convergence(logfile, plotfile='convergence.pdf')[source]

Makes a plot of the convergence of the cost function and its energy and force components.

Parameters:
  • logfile (str) – Name or path to the log file.
  • plotfile (str) – Name or path to the plot file.
amp.analysis.plot_error(load, images, label='error', dblabel=None, plot_forces=True, plotfile=None, color='b.', overwrite=False, returndata=False)[source]

Makes an error plot of Amp energies and forces versus real energies and forces.

Parameters:
  • load (str) – Path for loading an existing ”.amp” file. Should be fed like ‘load=”filename.amp”’.
  • images (list or str) – List of ASE atoms objects with positions, symbols, energies, and forces in ASE format. This can also be the path to an ASE trajectory (.traj) or database (.db) file. Energies can be obtained from any reference, e.g. DFT calculations.
  • label (str) – Default prefix/location used for all files.
  • dblabel (str) – Optional separate prefix/location of database files, including fingerprints, fingerprint primes, and neighborlists, to avoid calculating them. If not supplied, just uses the value from label.
  • plot_forces (bool) – Determines whether or not forces should be plotted as well.
  • plotfile (Object) – File for the plot.
  • color (str) – Plot color.
  • overwrite (bool) – If a plot or an script containing values found overwrite it.
  • returndata (bool) – Whether to return a reference to the figures and their data or not.
amp.analysis.plot_parity(load, images, label='parity', dblabel=None, plot_forces=True, plotfile=None, color='b.', overwrite=False, returndata=False)[source]

Makes a parity plot of Amp energies and forces versus real energies and forces.

Parameters:
  • load (str) – Path for loading an existing ”.amp” file. Should be fed like ‘load=”filename.amp”’.
  • images (list or str) – List of ASE atoms objects with positions, symbols, energies, and forces in ASE format. This can also be the path to an ASE trajectory (.traj) or database (.db) file. Energies can be obtained from any reference, e.g. DFT calculations.
  • label (str) – Default prefix/location used for all files.
  • dblabel (str) – Optional separate prefix/location of database files, including fingerprints, fingerprint primes, and neighborlists, to avoid calculating them. If not supplied, just uses the value from label.
  • plot_forces (bool) – Determines whether or not forces should be plotted as well.
  • plotfile (Object) – File for the plot.
  • color (str) – Plot color.
  • overwrite (bool) – If a plot or an script containing values found overwrite it.
  • returndata (bool) – Whether to return a reference to the figures and their data or not.
amp.analysis.plot_sensitivity(load, images, d=0.0001, label='sensitivity', dblabel=None, plotfile=None, overwrite=False, energy_coefficient=1.0, force_coefficient=0.04)[source]

Returns the plot of loss function in terms of perturbed parameters.

Takes the load file and images. Any other keyword taken by the Amp calculator can be fed to this class also.

Parameters:
  • load (str) – Path for loading an existing ”.amp” file. Should be fed like ‘load=”filename.amp”’.
  • images (list or str) – List of ASE atoms objects with positions, symbols, energies, and forces in ASE format. This can also be the path to an ASE trajectory (.traj) or database (.db) file. Energies can be obtained from any reference, e.g. DFT calculations.
  • d (float) – The amount of perturbation in each parameter.
  • label (str) – Default prefix/location used for all files.
  • dblabel (str) – Optional separate prefix/location of database files, including fingerprints, fingerprint primes, and neighborlists, to avoid calculating them. If not supplied, just uses the value from label.
  • plotfile (Object) – File for the plot.
  • overwrite (bool) – If a plot or an script containing values found overwrite it.
  • energy_coefficient (float) – Coefficient of energy loss in the total loss function.
  • force_coefficient (float) – Coefficient of force loss in the total loss function.
amp.analysis.read_trainlog(logfile, verbose=True)[source]

Reads the log file from the training process, returning the relevant parameters.

Parameters:
  • logfile (str) – Name or path to the log file.
  • verbose (bool) – Write out logfile during analysis.