def __init__(self, zval, pz, shape, var_axes=(0,),\
is_complex=False):
Estim.__init__(self)
# Convert scalars to arrays
if np.isscalar(zval):
zval = np.array([zval])
if np.isscalar(pz):
pz = np.array([pz])
# Set parameters
self.zval = zval
self.pz = pz
self.shape = shape
self.is_complex = is_complex
self.fz = -np.log(pz)
# Set the variance axes
if var_axes == 'all':
ndim = len(shape)
var_axes = tuple(range(ndim))
self.var_axes = var_axes
self.cost_avail = True
评论列表
文章目录