Conversation
033d336 to
1be0adf
Compare
|
This is a base prototype. What surely needs to get done
|
|
Summary after on-line call: We decided to re-consider architecture of the graph (yes, again); from new POV one can see analytical computations as loops with different labels is such graph. This will allow to
More specifically, we assume that
NOTE: options are still needed, because some of them may take values in continuous domain, or have discrete set of values, but it would be quite sad to redefine them in every transformation; labels and options should be orthogonal in that sense; |
7d315a6 to
3297870
Compare
|
3297870 to
4d798c1
Compare
| return distr.loop_is_analytical(characteristic_name, label_name) | ||
|
|
||
| @staticmethod | ||
| def _attach_analytical_loops( |
| def validate_univariate_continuous(distribution: DerivedDistribution) -> None: | ||
| """ | ||
| Validate that a distribution is univariate continuous. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| distribution : DerivedDistribution | ||
| Distribution to validate. | ||
|
|
||
| Raises | ||
| ------ | ||
| TypeError | ||
| If distribution kind or dimension is unsupported. | ||
| """ | ||
| distribution_type = distribution.distribution_type | ||
| kind = getattr(distribution_type, "kind", None) | ||
| dimension = getattr(distribution_type, "dimension", None) | ||
| if kind != Kind.CONTINUOUS or dimension != 1: | ||
| raise TypeError( | ||
| "Interpolation approximation currently supports only univariate " | ||
| "continuous distributions." | ||
| ) |
There was a problem hiding this comment.
Make additional private module _common_utils and move this function into it
| def _operation_value( | ||
| self, | ||
| left: float | NumericArray, | ||
| right: float | NumericArray, | ||
| ) -> float | NumericArray: | ||
| """Apply the concrete binary operation in scalar or array semantics.""" |
There was a problem hiding this comment.
During online call we decided that
- We should be able pass user defined transformation methods into init of DerivedDistribution (for user-defined characteristics e.g. fifth raw moment, or for user defined methods of computation of already defined characteristics e.g. user's method to compute PDF or CDF)
- We also should use this interface to fill default operations overload (
X + Y) - We should create separate file
evaluators.pywhere special function will create dictionary of default transformation methods for current operation; so user may be able to extend this dictionary or modify it
Base primitives and affine transformation for check. There is also an approximation, but it is very raw for now