Feature Normalization

As explained in the Uniform Scaling section, it is often useful for model inputs to be invariant under uniform scaling. However, many semilocal and nonlocal descriptors are not scale-invariant from the outset. To create scale-invariant features, “raw” features must be multiplied by an appropriate power of the density, and they can optionally be multiplied by other scale-invariant factors to improve their numerical behavior.

This is the role of the feature normalizers module. Feature normalizers combine a raw quantity \(x\) with the spin density and a dimensionless inhomogeneity variable to produce the uniform scaling behavior expected by a model. DensityNormalizer, InhomogeneityNormalizer, and GeneralNormalizer implement factors of the form

\[x_\mathrm n = c_1 x\,n^p(1+c_2 I)^q.\]

These objects’ backward operations propagate the model derivatives to \(x\), \(n\), and \(I\). get_usp reports the uniform scaling power of the normalizer term, and get_ueg returns its value for the uniform electron gas.

FeatNormalizerList applies one normalizer per raw feature. Its semilocal mode (slmode) determines how density, reduced-gradient, and kinetic-energy-density inputs form the inhomogeneity variable. The list and its cutoff are serialized with the feature settings when the model is stored.

class ciderpress.dft.feat_normalizer.FeatNormalizerList(normalizers, slmode, cutoff=1e-10)
Parameters:
  • normalizers (list[FeatNormalizer or None])

  • list of feature normalizers

This class provides tools for normalizing features to have more desirable behavior under uniform scaling.

class ciderpress.dft.feat_normalizer.ConstantNormalizer(const)
fill_bwd(dfdxn, x, rho, inh, dfdx=None, dfdrho=None, dfdinh=None)
Parameters:
  • dfdxn

  • x

  • rho

  • inh

  • dfdx – Can be empty

  • dfdrho – Must be initialized because it is added to

  • dfdinh – Must be initialized because it is added to

Returns:

fill_fwd(x, rho, inh, xn=None)
Parameters:
  • x

  • rho

  • inh

  • xn – Can be empty

Returns:

class ciderpress.dft.feat_normalizer.DensityNormalizer(const, power)
fill_bwd(dfdxn, x, rho, inh, dfdx=None, dfdrho=None, dfdinh=None)
Parameters:
  • dfdxn

  • x

  • rho

  • inh

  • dfdx – Can be empty

  • dfdrho – Must be initialized because it is added to

  • dfdinh – Must be initialized because it is added to

Returns:

fill_fwd(x, rho, inh, xn=None)
Parameters:
  • x

  • rho

  • inh

  • xn – Can be empty

Returns:

class ciderpress.dft.feat_normalizer.FeatNormalizer
abstractmethod fill_bwd(dfdxn, x, rho, inh, dfdx=None, dfdrho=None, dfdinh=None)
Parameters:
  • dfdxn

  • x

  • rho

  • inh

  • dfdx – Can be empty

  • dfdrho – Must be initialized because it is added to

  • dfdinh – Must be initialized because it is added to

Returns:

abstractmethod fill_fwd(x, rho, inh, xn=None)
Parameters:
  • x

  • rho

  • inh

  • xn – Can be empty

Returns:

class ciderpress.dft.feat_normalizer.GeneralNormalizer(const1, const2, power1, power2)
fill_bwd(dfdxn, x, rho, inh, dfdx=None, dfdrho=None, dfdinh=None)
Parameters:
  • dfdxn

  • x

  • rho

  • inh

  • dfdx – Can be empty

  • dfdrho – Must be initialized because it is added to

  • dfdinh – Must be initialized because it is added to

Returns:

fill_fwd(x, rho, inh, xn=None)
Parameters:
  • x

  • rho

  • inh

  • xn – Can be empty

Returns:

class ciderpress.dft.feat_normalizer.InhomogeneityNormalizer(const1, const2, power)
fill_bwd(dfdxn, x, rho, inh, dfdx=None, dfdrho=None, dfdinh=None)
Parameters:
  • dfdxn

  • x

  • rho

  • inh

  • dfdx – Can be empty

  • dfdrho – Must be initialized because it is added to

  • dfdinh – Must be initialized because it is added to

Returns:

fill_fwd(x, rho, inh, xn=None)
Parameters:
  • x

  • rho

  • inh

  • xn – Can be empty

Returns: