interfaces¶
-
class
zfit.core.interfaces.
ZfitData
[source]¶ Bases:
zfit.core.interfaces.ZfitDimensional
-
axes
¶ Return the axes.
-
copy
(deep: bool = False, **overwrite_params) → zfit.core.interfaces.ZfitObject¶
-
n_obs
¶ Return the number of observables.
-
name
¶ Name prepended to all ops created by this model.
-
obs
¶ Return the observables.
-
weights
¶
-
-
class
zfit.core.interfaces.
ZfitDimensional
[source]¶ Bases:
zfit.core.interfaces.ZfitObject
-
axes
¶ Return the axes.
-
copy
(deep: bool = False, **overwrite_params) → zfit.core.interfaces.ZfitObject¶
-
n_obs
¶ Return the number of observables.
-
name
¶ Name prepended to all ops created by this model.
-
obs
¶ Return the observables.
-
-
class
zfit.core.interfaces.
ZfitFunc
[source]¶ Bases:
zfit.core.interfaces.ZfitModel
-
axes
¶ Return the axes.
-
copy
(deep: bool = False, **overwrite_params) → zfit.core.interfaces.ZfitObject¶
-
dtype
¶ The DType of Tensor`s handled by this `model.
-
func
(x: Union[float, tensorflow.python.framework.ops.Tensor], name: str = 'value') → Union[float, tensorflow.python.framework.ops.Tensor][source]¶
-
get_dependents
(only_floating: bool = True) -> OrderedSet(['z', 'f', 'i', 't', '.', 'P', 'a', 'r', 'm', 'e'])¶
-
get_params
(only_floating: bool = False, names: Union[str, List[str], None] = None) → List[zfit.core.interfaces.ZfitParameter]¶
-
integrate
(limits: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool], norm_range: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool] = None, name: str = 'integrate') → Union[float, tensorflow.python.framework.ops.Tensor]¶ Integrate the function over limits (normalized over norm_range if not False).
Parameters: Returns: the integral value
Return type: Tensor
-
n_obs
¶ Return the number of observables.
-
name
¶ Name prepended to all ops created by this model.
-
obs
¶ Return the observables.
-
params
¶
-
partial_integrate
(x: Union[float, tensorflow.python.framework.ops.Tensor], limits: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool], norm_range: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool] = None, name: str = 'partial_integrate') → Union[float, tensorflow.python.framework.ops.Tensor]¶ Partially integrate the function over the limits and evaluate it at x.
Dimension of limits and x have to add up to the full dimension and be therefore equal to the dimensions of norm_range (if not False)
Parameters: Returns: the value of the partially integrated function evaluated at x.
Return type: Tensor
-
classmethod
register_analytic_integral
(func: Callable, limits: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool] = None, priority: int = 50, *, supports_norm_range: bool = False, supports_multiple_limits: bool = False)¶ Register an analytic integral with the class.
Parameters: - () (limits) –
- () – |limits_arg_descr|
- priority (int) –
- supports_multiple_limits (bool) –
- supports_norm_range (bool) –
Returns:
-
classmethod
register_inverse_analytic_integral
(func: Callable)¶ Register an inverse analytical integral, the inverse (unnormalized) cdf.
Parameters: () (func) –
-
sample
(n: int, limits: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool] = None, name: str = 'sample') → Union[float, tensorflow.python.framework.ops.Tensor]¶ Sample n points within limits from the model.
Parameters: Returns: Tensor(n_obs, n_samples)
-
update_integration_options
(*args, **kwargs)¶
-
-
class
zfit.core.interfaces.
ZfitLoss
[source]¶ Bases:
zfit.core.interfaces.ZfitObject
,zfit.core.interfaces.ZfitDependentsMixin
-
copy
(deep: bool = False, **overwrite_params) → zfit.core.interfaces.ZfitObject¶
-
data
¶
-
errordef
¶
-
fit_range
¶
-
get_dependents
(only_floating: bool = True) -> OrderedSet(['z', 'f', 'i', 't', '.', 'P', 'a', 'r', 'm', 'e'])¶
-
gradients
(params: Union[zfit.core.interfaces.ZfitParameter, int, float, complex, tensorflow.python.framework.ops.Tensor] = None) → List[tensorflow.python.framework.ops.Tensor][source]¶
-
model
¶
-
name
¶ Name prepended to all ops created by this model.
-
-
class
zfit.core.interfaces.
ZfitModel
[source]¶ Bases:
zfit.core.interfaces.ZfitNumeric
,zfit.core.interfaces.ZfitDimensional
-
axes
¶ Return the axes.
-
copy
(deep: bool = False, **overwrite_params) → zfit.core.interfaces.ZfitObject¶
-
dtype
¶ The DType of Tensor`s handled by this `model.
-
get_dependents
(only_floating: bool = True) -> OrderedSet(['z', 'f', 'i', 't', '.', 'P', 'a', 'r', 'm', 'e'])¶
-
get_params
(only_floating: bool = False, names: Union[str, List[str], None] = None) → List[zfit.core.interfaces.ZfitParameter]¶
-
integrate
(limits: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool], norm_range: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool] = None, name: str = 'integrate') → Union[float, tensorflow.python.framework.ops.Tensor][source]¶ Integrate the function over limits (normalized over norm_range if not False).
Parameters: Returns: the integral value
Return type: Tensor
-
n_obs
¶ Return the number of observables.
-
name
¶ Name prepended to all ops created by this model.
-
obs
¶ Return the observables.
-
params
¶
-
partial_integrate
(x: Union[float, tensorflow.python.framework.ops.Tensor], limits: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool], norm_range: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool] = None, name: str = 'partial_integrate') → Union[float, tensorflow.python.framework.ops.Tensor][source]¶ Partially integrate the function over the limits and evaluate it at x.
Dimension of limits and x have to add up to the full dimension and be therefore equal to the dimensions of norm_range (if not False)
Parameters: Returns: the value of the partially integrated function evaluated at x.
Return type: Tensor
-
classmethod
register_analytic_integral
(func: Callable, limits: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool] = None, priority: int = 50, *, supports_norm_range: bool = False, supports_multiple_limits: bool = False)[source]¶ Register an analytic integral with the class.
Parameters: - () (limits) –
- () – |limits_arg_descr|
- priority (int) –
- supports_multiple_limits (bool) –
- supports_norm_range (bool) –
Returns:
-
classmethod
register_inverse_analytic_integral
(func: Callable)[source]¶ Register an inverse analytical integral, the inverse (unnormalized) cdf.
Parameters: () (func) –
-
-
class
zfit.core.interfaces.
ZfitNumeric
[source]¶ Bases:
zfit.core.interfaces.ZfitDependentsMixin
,zfit.core.interfaces.ZfitObject
-
copy
(deep: bool = False, **overwrite_params) → zfit.core.interfaces.ZfitObject¶
-
dtype
¶ The DType of Tensor`s handled by this `model.
-
get_dependents
(only_floating: bool = True) -> OrderedSet(['z', 'f', 'i', 't', '.', 'P', 'a', 'r', 'm', 'e'])¶
-
get_params
(only_floating: bool = False, names: Union[str, List[str], None] = None) → List[zfit.core.interfaces.ZfitParameter][source]¶
-
name
¶ Name prepended to all ops created by this model.
-
params
¶
-
-
class
zfit.core.interfaces.
ZfitObject
[source]¶ Bases:
abc.ABC
-
name
¶ Name prepended to all ops created by this model.
-
-
class
zfit.core.interfaces.
ZfitPDF
[source]¶ Bases:
zfit.core.interfaces.ZfitModel
-
axes
¶ Return the axes.
-
copy
(deep: bool = False, **overwrite_params) → zfit.core.interfaces.ZfitObject¶
-
create_extended
(yield_: Union[zfit.core.interfaces.ZfitParameter, int, float, complex, tensorflow.python.framework.ops.Tensor]) → zfit.core.interfaces.ZfitPDF[source]¶
-
dtype
¶ The DType of Tensor`s handled by this `model.
-
get_dependents
(only_floating: bool = True) -> OrderedSet(['z', 'f', 'i', 't', '.', 'P', 'a', 'r', 'm', 'e'])¶
-
get_params
(only_floating: bool = False, names: Union[str, List[str], None] = None) → List[zfit.core.interfaces.ZfitParameter]¶
-
integrate
(limits: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool], norm_range: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool] = None, name: str = 'integrate') → Union[float, tensorflow.python.framework.ops.Tensor]¶ Integrate the function over limits (normalized over norm_range if not False).
Parameters: Returns: the integral value
Return type: Tensor
-
is_extended
¶
-
n_obs
¶ Return the number of observables.
-
name
¶ Name prepended to all ops created by this model.
-
normalization
(limits: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool], name: str = 'normalization') → Union[tensorflow.python.framework.ops.Tensor, numpy.array][source]¶
-
obs
¶ Return the observables.
-
params
¶
-
partial_integrate
(x: Union[float, tensorflow.python.framework.ops.Tensor], limits: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool], norm_range: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool] = None, name: str = 'partial_integrate') → Union[float, tensorflow.python.framework.ops.Tensor]¶ Partially integrate the function over the limits and evaluate it at x.
Dimension of limits and x have to add up to the full dimension and be therefore equal to the dimensions of norm_range (if not False)
Parameters: Returns: the value of the partially integrated function evaluated at x.
Return type: Tensor
-
pdf
(x: Union[float, tensorflow.python.framework.ops.Tensor], norm_range: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool] = None, name: str = 'model') → Union[float, tensorflow.python.framework.ops.Tensor][source]¶
-
classmethod
register_analytic_integral
(func: Callable, limits: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool] = None, priority: int = 50, *, supports_norm_range: bool = False, supports_multiple_limits: bool = False)¶ Register an analytic integral with the class.
Parameters: - () (limits) –
- () – |limits_arg_descr|
- priority (int) –
- supports_multiple_limits (bool) –
- supports_norm_range (bool) –
Returns:
-
classmethod
register_inverse_analytic_integral
(func: Callable)¶ Register an inverse analytical integral, the inverse (unnormalized) cdf.
Parameters: () (func) –
-
sample
(n: int, limits: Union[Tuple[Tuple[float, ...]], Tuple[float, ...], bool] = None, name: str = 'sample') → Union[float, tensorflow.python.framework.ops.Tensor]¶ Sample n points within limits from the model.
Parameters: Returns: Tensor(n_obs, n_samples)
-
update_integration_options
(*args, **kwargs)¶
-
-
class
zfit.core.interfaces.
ZfitParameter
[source]¶ Bases:
zfit.core.interfaces.ZfitNumeric
-
copy
(deep: bool = False, **overwrite_params) → zfit.core.interfaces.ZfitObject¶
-
dtype
¶ The DType of Tensor`s handled by this `model.
-
floating
¶
-
get_dependents
(only_floating: bool = True) -> OrderedSet(['z', 'f', 'i', 't', '.', 'P', 'a', 'r', 'm', 'e'])¶
-
get_params
(only_floating: bool = False, names: Union[str, List[str], None] = None) → List[zfit.core.interfaces.ZfitParameter]¶
-
independent
¶
-
name
¶ Name prepended to all ops created by this model.
-
params
¶
-
-
class
zfit.core.interfaces.
ZfitSpace
[source]¶ Bases:
zfit.core.interfaces.ZfitObject
-
area
() → float[source]¶ Return the total area of all the limits and axes. Useful, for example, for MC integration.
-
axes
¶
-
copy
(deep: bool = False, **overwrite_params) → zfit.core.interfaces.ZfitObject¶
-
get_axes
(obs: Union[str, Tuple[str, ...]] = None, as_dict: bool = True)[source]¶ Return the axes number of the observable if available (set by axes_by_obs).
Raises: AxesNotUnambiguousError
– In case
-
get_subspace
(obs: Union[str, Iterable[str], zfit.Space] = None, axes=None, name=None) → zfit.core.limits.Space[source]¶
-
iter_limits
()[source]¶ Iterate through the limits by returning several observables/(lower, upper)-tuples.
-
limits
¶ Return the tuple(lower, upper).
-
lower
¶ Return the lower limits.
-
n_limits
¶ Return the number of limits.
-
n_obs
¶ Return the number of observables (axis).
-
name
¶ Name prepended to all ops created by this model.
-
obs
¶ Return a list of the observable names.
-
upper
¶ Return the upper limits.
-
with_autofill_axes
(overwrite: bool)[source]¶ Return a
Space
with filled axes corresponding to range(len(n_obs)).Parameters: overwrite (bool) – If self.axes is not None, replace the axes with the autofilled ones. If axes is already set, don’t do anything if overwrite is False. Returns: Space
-
with_axes
(axes)[source]¶ Sort by obs and return the new instance.
Parameters: () (axes) – Returns: Space
-