softMax |
index |
Helper module to compute an approximate maximum (or minimum) coordinate value The soft max value is given by zsoftMax or zlogSumExp The logSumExp expression is where the sum is over all chosen atoms, and
zi = p⋅qi + ri, p is a unit vector in the direction given by the
projection member, qi and ri are the position and
radius of atom i, respectively. [The actual exponential computation is relative to the maximum value -
to avoid overflows.]
in a chosen direction.
Thus, the soft max is an approximation to the bounds of a collection
of coordinates which is smooth as the identity of the involved atoms
changes.
Constructor:
SoftMax(sel,
gamma=1,
type="softMax")
The first argument is a string or atomSel.AtomSel object
describing the collection of atoms to describe. The type argument
is either "softMax" or "logSumExp".
Methods:
value() - Return the soft max value.
hardValue() - Return the hard (actual) maximum value.
selection() - return the sel argument specified in the constructor.
derivs(pref, - compute a gradient with respect to coordinates given
derivs) a constant pref value, and a derivList.DerivList
object.
Accessors:
gamma - the softness parameter in the above equation: the larger
this value, the softer the function (and the worse the
approximation is to the hardValue).
radii - a vector of radii size len(sel). All radii are 0 by
default.
projection - direction in which to compute the maximum - the z
direction (0,0,1) by default.
isMinimum - If True, the minimum value in the given direction is
computed - by appropriately setting gamma to a negative
value.
type - Specify the soft max expression, "softMax" or "logSumExp".
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
Classes | ||||||||||
|
Functions | ||
|