src/beanmachine/ppl/compiler/runtime.py (45 lines): - line 6: # TODO: Update this comment - line 210: # TODO: Support kwargs - line 366: # TODO: Add a note here describing why it is important that the function - line 370: # TODO: Verify that they do match. - line 591: # TODO: We probably need to make a distinction between torch.mm and - line 733: # TODO: Unfortunately, the second rule does not match the actual behavior of - line 770: # TODO: What if we have a non-tensor indexed with a stochastic value? - line 813: # TODO: Remove this. We should insert TO_REAL nodes when necessary - line 934: # TODO: We have a problem that we need to resolve regarding compilation of models - line 969: # TODO: Should we produce some sort of warning here telling the user that - line 983: # TODO: This scenario is another opportunity for a warning or error, since - line 1077: # TODO: Better error - line 1082: # TODO: Better error - line 1164: # TODO: Note that we only memoize calls to RVs when the arguments - line 1190: # TODO: Better error - line 1206: # TODO: Better exception - line 1214: # TODO: Better exception - line 1220: # TODO: Better exception - line 1224: # TODO: Note that this can be a considerable overestimate. For example, if we - line 1229: # TODO: Make max_possibilities a global tweakable setting of the accumulator. - line 1235: # TODO: Better exception - line 1245: # TODO: Better error - line 1248: # TODO: What happens if we have a @functional that does not return - line 1249: # TODO: a graph node? A functional that returns a constant is - line 1250: # TODO: weird, but it should be legal. Figure out what the - line 1251: # TODO: right thing to do is for this scenario. - line 1336: # TODO: Do we need to consider the scenario where we do not have - line 1342: # TODO: Handle kwargs - line 1422: # TODO: Do a sanity check that the arguments match and give - line 1423: # TODO: a good error if they do not. Alternatively, catch - line 1424: # TODO: the exception if the call fails and replace it with - line 1425: # TODO: a more informative error. - line 1436: # TODO: What happens if the function is a member of a class? - line 1437: # TODO: Do we recompile it for different instances of the - line 1438: # TODO: receiver? Do we recompile it on every call? Check this. - line 1447: # TODO: Better error message - line 1527: # TODO: Better error - line 1562: # TODO: Get this into alpha order - line 1569: # TODO: Better error - line 1584: # TODO: There are a great many more pure instance functions on tensors; - line 1585: # TODO: which do we wish to support? - line 1622: # TODO: Better error - line 1627: # TODO: Better error - line 1633: # TODO: Better error - line 1639: # TODO: Better error src/beanmachine/ppl/compiler/single_assignment.py (31 lines): - line 9: # TODO: This module is badly named; it really should be "python simplifier" or some - line 25: # * id = simple_expression # TODO: List the simple expressions. - line 30: # * [id] = id # TODO: What about tuples? - line 48: # * dict() is allowed. (TODO: this could be rewritten to {}) - line 51: # * TODO: There are similar exceptions for set and list; say what they are. - line 58: # TODO: assert statements are removed in bm_to_bmg; move that functionality here. - line 59: # TODO: We can reduce "del" statements to one of three forms: "del x", "del x.y", "del x[y]" - line 61: # TODO: Figure out how to desugar try: body except expr as bar: body else: body finally: body - line 63: # TODO: Figure out how to desugar with expr as target : block - line 65: # TODO: say something about global / nonlocal - line 66: # TODO: say something about yield - line 67: # TODO: say something about classes - line 68: # TODO: say something about type annotations - line 69: # TODO: say something about async - line 70: # TODO: say something about conditional expressions - line 71: # TODO: say something about formatted strings - line 147: # TODO: The identifier "dict" should be made global unique in target name space - line 180: # TODO: Better naming convention. In particular, _rules is the reflexive - line 215: # TODO: In the type this function, both instances of the type Any should - line 359: # TODO: The identifier "dict" should be made global unique in target name space - line 573: # TODO: Should we also eliminate plain returns? We could rewrite - line 611: # TODO: We can go further than this and eliminate all else clauses - line 654: # TODO: the "for" loop in Python supports an "else" clause which is only activated - line 657: # TODO: the "for" loop could be rewritten as fetching an iterator and iterating - line 1285: # TODO: Ideally, would like to merge [1].ctx with the [0].ctx below - line 1322: # TODO: Ideally, would like to merge [1].ctx with the [0].ctx below - line 1323: # TODO: The identifier "dict" should be made global unique in target name space - line 1389: # TODO: The identifier "dict" should be made global unique in target name space - line 1445: # TODO: The identifier "dict" should be made global unique in target name space - line 1540: # TODO: Note that this rule combined with the previous rule - line 2079: # TODO: We need to find a good way to order things in this file src/beanmachine/ppl/compiler/bm_graph_builder.py (19 lines): - line 42: # TODO: The original idea was to use these integers when generating code - line 106: # TODO: The code in the "handle" methods which folds operations - line 113: # TODO: This should be private - line 124: # TODO: This is only used to remove an observation; restrict it - line 141: # TODO: This is only used to remove observation sample node that - line 350: # TODO: This code is mostly but not entirely in alpha order - line 469: # TODO: This code is not very well organized; consider sorting it - line 610: # TODO: We don't have a subtraction node; we render this as - line 723: # TODO: We could optimize -(-x) to x here. - line 744: # TODO: What should the result of NOT on a tensor be? - line 745: # TODO: Should it be legal at all in the graph? - line 746: # TODO: In Python, (not tensor(x)) is equal to (not x). - line 747: # TODO: It is NOT equal to (tensor(not x)), which is what - line 748: # TODO: you might expect. - line 909: # TODO: Verify that the list is well-formed. - line 920: # TODO: Should this be idempotent? - line 921: # TODO: Should it be an error to add two unequal observations to one node? - line 929: # TODO: BMG requires that the target of a query be classified - line 976: # TODO: The graph should be acyclic by construction; src/beanmachine/graph/graph.cpp (19 lines): - line 213: // TODO: the following is used in beta.cpp only. Does it really need to be here? - line 308: // TODO: Investigate the semantics of _backward(skip_observed), - line 330: // TODO: used for testing only, should integrate it with - line 411: // TODO: As of May 2021, this method is being used for testing only. - line 439: // TODO: remove this error message and leave it to compute_gradients - line 446: // TODO: can we make signature use a default generator then? - line 457: // TODO clarify why we need to reset gradients - line 480: // TODO: also used in tests only - line 502: // TODO: this is the one actually used in code (as opposed to full_log_prob used - line 520: // TODO: rename log_abs_jacobian_determinant - line 537: /* TODO: used in testing only; it looks like there has not been a need for it in - line 549: // TODO: from now on, we have methods for adding nodes, checking validity, - line 555: // TODO: this does not have to apply to parents only; make it a more general - line 804: // TODO: Add checks that the observed value is in range. - line 833: // TODO: Add checks that the observed values are in range. - line 834: // TODO: Check that an observed simplex is given a simplex. - line 967: // TODO: clarify the meaning of log_prob_vals and log_prob_allchains - line 1044: // TODO: why don't the initialization below to be done for _infer? - line 1187: return variational_params; // TODO: this should have been defined as a field, src/beanmachine/ppl/compiler/bmg_nodes.py (15 lines): - line 375: # TODO: We do not yet have a BMG node for Binomial - line 391: # TODO: we may wish to add bounded integers to the BMG type system. - line 488: # TODO: Add support for the Cauchy distribution as well. - line 571: # TODO: We do not yet have an implementation of the uniform - line 948: # TODO: Should we implement a general switch node in BMG? - line 956: # TODO: Check that cases are all constant nodes. - line 957: # TODO: Check that there is one value for each case. - line 1004: # TODO: We now have matrix multiplication in BMG; finish this implementation - line 1064: # TODO: If we have exp(x) - 1 in the graph and x is known to be of type - line 1099: # TODO: replace "log" with "log1mexp" as needed below and update defs - line 1330: # TODO: Here we treat an observation as node which takes input - line 1338: # TODO: **Observations are logically distinct from models.** - line 1350: # TODO: Consider adding a verification pass which ensures - line 1368: # TODO: BMG requires that the target of a query be classified - line 1374: # TODO: As with observations, properly speaking there is no src/beanmachine/ppl/compiler/bm_to_bmg.py (11 lines): - line 53: # TODO: Detect unsupported operators - line 54: # TODO: Detect unsupported control flow - line 55: # TODO: Would be helpful if we could track original source code locations. - line 405: # TODO: Add classes, lambdas, and so on - line 440: # TODO: Handle the situation if there are tabs - line 503: # TODO: Consider producing a warning or error if we cannot determine which lambda - line 506: # TODO: return None if we are unable to get the source - line 564: # TODO: return None if we are unable to get the source - line 687: # TODO: Consider detecting jitted functions which use the nonlocal statement, and - line 690: # TODO: rename bmg outer variable to something less likely - line 841: # TODO: This method is only here for testing purposes. Get rid of it. src/beanmachine/ppl/compiler/fix_unsupported.py (11 lines): - line 47: # TODO: Suppose we have something like Uniform(1.0, 2.0). Can we replace that - line 120: # TODO: If left is a ToMatrixNode then we can construct a second - line 208: # TODO: If we have a contiguous set of cases, say {2, 3, 4}, then - line 212: # TODO: If we have a slightly noncontiguous set of cases, say {0, 1, 3}, - line 216: # TODO: If we have arbitrary natural cases, say 1, 10, 101, then we could - line 257: # TODO: Consider producing a warning for this situation, because - line 276: # TODO: Generate a better error message for switches that we cannot yet - line 295: # TODO: - line 345: # TODO: We should make a rewriter that detects stochastic index - line 357: # TODO: We have an ordering problem in the fixers: - line 394: # TODO: The edge labels used to visualize the graph in DOT src/beanmachine/ppl/compiler/fix_vectorized_models.py (9 lines): - line 14: # TODO Move this to a utils module - line 38: # TODO: Consider optimizing distributions where the tensor elements are all - line 62: # TODO: categorical - line 63: # TODO: categorical logit - line 64: # TODO: dirichlet - line 81: # TODO: Do addition and multiply need to be the multi- versions? - line 92: # TODO soon: LogSumExp, ExpM1, Logm1exp - line 93: # TODO later: all comparisons, all bitwise, floordiv, - line 235: # TODO: What if the observation is of a different size than the src/beanmachine/ppl/compiler/bmg_requirements.py (8 lines): - line 130: # TODO: BMG requires it to be a *broadcast* matrix; what happens - line 141: # TODO: This will produce a bad error message experience. What we want to - line 184: # TODO: The current code produces a bad error message experience because at - line 231: # TODO: Consider what to do if the node type is Tensor. - line 237: # TODO: Consider what to do if the node type is Tensor. - line 286: # TODO: We might consider an optimization pass which does so. - line 334: # TODO: We need a better error message for that scenario. - line 370: # TODO: What about simplex matrices? It should be legal to do src/beanmachine/ppl/compiler/patterns.py (7 lines): - line 30: # TODO: Tensor comprehension patterns - line 62: # TODO: Display as a tree and graph also - line 68: # TODO: If we save the patterns that failed as well, then we can build a - line 69: # TODO: diagnostic engine that describes why a value failed to match against - line 70: # TODO: a complex pattern. - line 592: # TODO: We could bail out after the first success. - line 615: # TODO: We could bail out after the first failure. src/beanmachine/graph/graph.h (6 lines): - line 473: // TODO: shouldn't we then restrict them to those classes? See below. - line 481: // TODO: shouldn't we then restrict them to those classes? See above. - line 795: // TODO: This public method returns a pointer to an internal data structure - line 802: // TODO: create Samples class and remove the following friend classes - line 812: // TODO: a lot of members used to be private, but we need access to them - line 871: // TODO: Review what members of this class can be made static. src/beanmachine/ppl/experimental/vi/variational_infer.py (6 lines): - line 68: # TODO: reinterpret batch dimension? - line 144: # TODO: caused by e.g. negative scales in `dist.Normal`; - line 291: # TODO: add new `self.world_.params_` not already in optimizer - line 319: # TODO: more general enumeration - line 326: # TODO: downstream observation likelihoods p(obs | rvid) - line 345: # TODO: caused by e.g. negative scales in `dist.Normal`; src/beanmachine/ppl/compiler/fix_requirements.py (5 lines): - line 174: # TODO: We do not yet handle the case where we are converting from, say, - line 184: # TODO: We do not yet handle the case where we are converting from - line 211: # TODO: We might want to restrict this. For example, if we have - line 219: # TODO: We might want to build a warning mechanism that informs the developer - line 404: # TODO: The edge labels used to visualize the graph in DOT src/beanmachine/ppl/compiler/bmg_types.py (5 lines): - line 60: # TODO: We might also need: - line 656: # TODO: add a range check to make sure it fits into the integer - line 688: # TODO: Move this to bmg_requirements.py - line 730: # TODO: Mark this as abstract - line 740: # TODO: Memoize these, remove memoization of construction functions below. src/beanmachine/ppl/compiler/lattice_typer.py (5 lines): - line 231: # TODO: Consider adding a pass which optimizes away IF(X, Y, Y) to - line 233: # TODO: What if we have an atomic type on one side and a 1x1 matrix - line 238: # TODO: We need to consider what happens if the consequence and alternative - line 251: # TODO: We need to consider what happens if the value's types - line 394: # TODO: Consider asserting that the node is unsupported by BMG. src/beanmachine/graph/to_dot.cpp (4 lines): - line 57: // TODO: Better display of matrices - line 62: // TODO: Better display of simplexes - line 202: // TODO: Include value of observation - line 236: // TODO: Better display of factors. src/beanmachine/ppl/compiler/sizer.py (4 lines): - line 150: # TODO: Is there a better way to do this other than try it and see what happens? - line 151: # TODO: Try torch.distributions.utils.broadcast_all - line 202: # TODO: - line 234: # TODO: Torch supports both broadcasting and non-broadcasting versions src/beanmachine/ppl/compiler/support.py (4 lines): - line 81: # TODO: We could do better for the comparison operators because we known - line 120: # TODO: - line 241: # TODO: This approximation is an over-estimate; for instance, when - line 302: # TODO: Move this prod helper function out of bmg_nodes.py src/beanmachine/ppl/inference/bmg_inference.py (4 lines): - line 73: # TODO: Figure out a better way to pass this flag around - line 224: # TODO: Make _rv_to_query public. Add it to BMGraphBuilder? - line 261: # TODO: Add verbose level - line 262: # TODO: Add logging src/beanmachine/ppl/compiler/error_report.py (4 lines): - line 21: # TODO: We use the DOT label of the node in the error messages here, - line 55: # TODO: Fix this error message for the case where we require - line 98: # TODO: Improve wording and diagnosis. - line 118: # TODO: Better error src/beanmachine/ppl/compiler/fix_observations.py (4 lines): - line 52: # TODO: How should we deal with observations of - line 53: # TODO: matrix-valued samples? - line 55: # TODO: Handle the case where there are two inconsistent - line 56: # TODO: observations of the same sample src/beanmachine/ppl/compiler/ast_patterns.py (3 lines): - line 148: # TODO: what should we do about AnnAssign? - line 478: # TODO: Matches "tensor" and "foo.tensor" - line 479: # TODO: Do we need to specifically match just torch? What if there is an alias? src/beanmachine/ppl/compiler/bmg_node_types.py (3 lines): - line 6: # TODO: For reasons unknown, Pyre is unable to find type information about - line 7: # TODO: beanmachine.graph from beanmachine.ppl. I'll figure out why later; - line 8: # TODO: for now, we'll just turn off error checking in this module. src/beanmachine/ppl/compiler/profiler.py (3 lines): - line 50: # TODO: Sort by total time of children - WARNING: Important not to sort by - line 52: # TODO: compute unattributed via property - line 58: # TODO: There are two shortcomings to the current solution. First, it prints src/beanmachine/ppl/experimental/inference_compilation/ic_infer.py (3 lines): - line 390: # TODO: bottlenecking? - line 449: # TODO: try pooling rather than just slicing out last hidden - line 509: # TODO: non-diagonal covariance src/beanmachine/ppl/experimental/vi/mean_field_variational_approximation.py (3 lines): - line 90: # TODO: remove once fixed upstream - line 93: # TODO: This needs to be now set after self.new_dist has been instantiated - line 165: # TODO: do we need to a _sum_rightmost here? src/beanmachine/graph/global/global_state.cpp (2 lines): - line 29: // TODO: rename to initialize_unconstrained_value_types - line 73: sto_node->get_unconstrained_value(true); // TODO: rename this function website/documentation.toml (2 lines): - line 13: # TODO: Base path for Docusaurus 2 content - line 16: # TODO: regular expression for sections that are visible initially: unfurled = "..." src/beanmachine/ppl/compiler/fix_beta_conjugate_prior.py (2 lines): - line 26: # TODO: For now we support conjugate prior transformation on - line 36: # TODO: This check can be removed if it is not a necessary condition. src/beanmachine/ppl/legacy/inference/abstract_mh_infer.py (2 lines): - line 323: # TODO adjust log density on numerical runtime errors - line 387: # TODO: Consider allowing values that can be converted to tensors. src/beanmachine/ppl/compiler/fix_normal_conjugate_prior.py (2 lines): - line 29: # TODO: For now we support conjugate prior transformation on - line 40: # TODO: This check can be removed if it is not a necessary condition. src/beanmachine/graph/global/util.cpp (2 lines): - line 19: // TODO: add simplex transform - line 29: // TODO: rename method to be more clear src/beanmachine/ppl/diagnostics/common_statistics.py (2 lines): - line 41: """TODO have separate diagnostics for discrete variables. - line 79: """TODO have separate diagnostics for discrete variables. src/beanmachine/ppl/testlib/hypothesis_testing.py (2 lines): - line 66: # TODO: Consider refactoring the common input checks for both methods - line 78: # TODO: We use z_{1-alpha} instead of -z_alpha for compatibility src/beanmachine/ppl/compiler/rules.py (2 lines): - line 292: # TODO: Consider implementing some sort of warning for this case? - line 686: # TODO: always_succeeds will be wrong for the returned object. src/beanmachine/graph/operator/linalgop.cpp (2 lines): - line 180: // TODO: change type to ranged natural - line 226: // TODO: change type to ranged natural src/beanmachine/graph/mh.h (2 lines): - line 90: // TODO: this should be delegated to steppers, since that's - line 94: // TODO: review what really needs to be private or public in MH's API. src/beanmachine/applications/hme/abstract_model.py (2 lines): - line 131: # TODO: add support for data pre-processing on random effects - line 144: # TODO: add support for random slope src/beanmachine/ppl/utils/memoize.py (2 lines): - line 174: # TODO: We do not collect statistics on memoization use here. - line 175: # TODO: We do not canonicalize arguments as the memoizer does above. src/beanmachine/ppl/compiler/fix_bool_arithmetic.py (1 line): - line 36: # TODO: We could support b ** n where b is bool and n is a natural src/beanmachine/ppl/compiler/internal_error.py (1 line): - line 84: # TODO: Consider adding a compiler version number, hash src/beanmachine/graph/stepper/single_site/nmc_scalar_single_site_stepping_method.cpp (1 line): - line 54: // TODO: generalize so it works with any proposer, not just nmc_proposer: src/beanmachine/graph/operator/operator.h (1 line): - line 38: // TODO: should we just remove it from Operator then? src/beanmachine/ppl/compiler/gen_bmg_graph.py (1 line): - line 107: # TODO: We could consider traversing only nodes reachable from src/beanmachine/graph/distribution/categorical.cpp (1 line): - line 84: // TODO: Yeah, how? src/beanmachine/graph/global/global_mh.cpp (1 line): - line 22: // TODO: tie samples directly to inference src/beanmachine/ppl/compiler/beanstalk_common.py (1 line): - line 10: # TODO: Allowing these constructions raises additional problems that src/beanmachine/applications/hme/null_mixture_model.py (1 line): - line 232: # FIXME: update the method to support customized prediction goal src/beanmachine/graph/proposer/proposer.h (1 line): - line 11: // TODO: should change name to "Proposal" to better match the literature. src/beanmachine/ppl/compiler/fix_problems.py (1 line): - line 45: # TODO: Add other notes on ordering constraints here. src/beanmachine/ppl/compiler/fix_multiary_ops.py (1 line): - line 33: # TODO: This is a bit opaque. Add a helper method for this. src/beanmachine/ppl/compiler/fix_bool_comparisons.py (1 line): - line 134: # TODO: Should we treat "x is y" the same as "x == y" when they are scripts/convert_ipynb_to_mdx.py (1 line): - line 210: # TODO: Handle svg images. src/beanmachine/ppl/experimental/gp/models.py (1 line): - line 118: # TODO: Make sure observation noise is transformed correctly src/beanmachine/ppl/legacy/world/world.py (1 line): - line 772: # TODO: messy, consider strategy pattern src/beanmachine/ppl/inference/proposer/single_site_uniform_proposer.py (1 line): - line 24: # TODO: we should sample from a transformed dist src/beanmachine/graph/stepper/single_site/default_single_site_stepping_method.cpp (1 line): - line 89: // TODO: the reason for that is not clear; sphinx/source/docs.py (1 line): - line 199: # TODO: Would be slightly faster if we applied module filtering inside walk_packages src/beanmachine/graph/mh.cpp (1 line): - line 227: // TODO: eventually we want to have different classes of Node src/beanmachine/ppl/compiler/typer_base.py (1 line): - line 38: # type information has already been cached. (TODO: Is this useful? Maybe remove it.) src/beanmachine/graph/stepper/single_site/nmc_dirichlet_gamma_single_site_stepping_method.cpp (1 line): - line 107: // TODO: identify code that depends on this, let it zero gradients src/beanmachine/graph/proposer/default_initializer.cpp (1 line): - line 25: // TODO: it seems like the initializer is needing to know src/beanmachine/ppl/compiler/gen_dot.py (1 line): - line 41: # TODO: It is strange having a visualizer that edits the graph