-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Contract to optimizer #105
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eb8680
commented
Mar 28, 2019
if path_end_reduced_vars: | ||
path_end = Reduce(reduce_op, path_end, path_end_reduced_vars) | ||
|
||
path_end = Contract(sum_op, prod_op, ta, tb, path_end_reduced_vars) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the path optimizer can be called recursively here if ta
or tb
are Finitary
fritzo
approved these changes
Mar 28, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
eb8680
added a commit
that referenced
this pull request
Jun 28, 2019
commit 3a80b29 Author: eb8680 <[email protected]> Date: Thu Jun 27 14:17:26 2019 -0700 Make substitution an interpretation (#155) * make substitute into an interpretation * simplify interpretation and add numpy+tco test to Makefile * tweak Independent * remove substitute_funsor * uncomment long examples * conditionally xfail some numpy tests * update semantics of Independent to be compatible with substitution changes * add Module to ground types commit ce5cdeb Author: eb8680 <[email protected]> Date: Wed Jun 26 10:18:32 2019 -0700 Remove eager_subs method from Joint (#154) commit ba0dfcb Author: eb8680 <[email protected]> Date: Tue Jun 25 15:04:38 2019 -0700 Separate generic and fresh variables in substitute (#153) commit 14766ef Author: eb8680 <[email protected]> Date: Tue Jun 25 14:52:19 2019 -0700 Remove most eager_subs methods from terms with no fresh variables (#152) commit 7e456e6 Author: eb8680 <[email protected]> Date: Tue Jun 25 13:34:58 2019 -0700 Alpha renaming of bound variables (#148) commit 3edfb0f Author: Fritz Obermeyer <[email protected]> Date: Wed Jun 5 09:58:30 2019 -0700 Use classifiers to specify the license (#150) commit d1cd1d2 Author: eb8680 <[email protected]> Date: Fri May 24 11:10:14 2019 -0700 Add an explicit stack-based interpreter (#147) commit ac02dcc Author: Fritz Obermeyer <[email protected]> Date: Mon May 6 11:02:20 2019 -0700 Update badge to point to travis-ci.com (#143) commit 416cff6 Author: Fritz Obermeyer <[email protected]> Date: Thu May 2 14:45:10 2019 -0700 Promote Einsum to a funsor for pattern matching (#142) commit 30e4255 Author: Fritz Obermeyer <[email protected]> Date: Thu May 2 10:46:24 2019 -0700 Update CI to use PyTorch 1.1.0 (#141) * Update CI to use PyTorch 1.1.0 * Fix travis version * Accommodate change to torch.max return type commit 00c467d Author: eb8680 <[email protected]> Date: Wed May 1 22:57:54 2019 -0700 Add model and guide auxiliary variable elimination to minipyro.elbo (#126) * add auxiliary variable elimination to minipyro.elbo to mimic TraceEnum_ELBO * optional partial_sum_product * Common subexpression elimination * add a test for traceenum_elbo * add two more tests, one of which is xfailing... * Simplify test and minipyro (#140) * Add smoke test for gaussian-probit model * Remove bogus assertion * Fix TraceEnum_ELBO to use EnumerateMessenger * remove EnumerateMessenger * add optional optimization to traceenum_elbo and mark monte carlo test xfail commit c77dc99 Author: JP <[email protected]> Date: Wed May 1 21:26:07 2019 -0700 rtd fix to not install torch 1.0 (#139) commit 2e5fd40 Author: JP <[email protected]> Date: Wed May 1 14:10:27 2019 -0700 deploy documentation (#138) commit cb09325 Author: Fritz Obermeyer <[email protected]> Date: Wed May 1 12:19:14 2019 -0700 Add generic Bernoulli wrapper around probs,logits version (#137) commit 45e0434 Author: Fritz Obermeyer <[email protected]> Date: Wed May 1 12:11:03 2019 -0700 Refactor elbos (#136) * Refactor elbos * Fix jit classes commit 1f5f602 Author: Fritz Obermeyer <[email protected]> Date: Tue Apr 30 23:57:13 2019 -0700 Add BernoulliLogits distribution (#135) commit df25607 Author: Fritz Obermeyer <[email protected]> Date: Tue Apr 30 15:51:38 2019 -0700 Avoid legacy constructors (#134) commit 92e85c3 Author: Fritz Obermeyer <[email protected]> Date: Mon Apr 29 11:14:31 2019 -0700 Add JitTrace_ELBO class to minipyro (#133) * Add JitTrace_ELBO class to minipyro * Enable minipyro --jit test * Simplify JitTrace_ELBO * Make Gaussian math jit compatible * Add unit tests for BlockVector and BlockMatrix * Fix docs * Tweak docs commit 5053f55 Author: Fritz Obermeyer <[email protected]> Date: Fri Apr 12 14:09:23 2019 -0400 Remove dependency on pyro ParamStoreDict (#129) commit 79a8621 Author: Fritz Obermeyer <[email protected]> Date: Thu Apr 11 21:15:00 2019 -0700 Support constraints in funsor.minipyro (#128) * Support constraints in funsor.minipyro * Make minipyro tests a little stronger * Save metadata to value.unconstrained() commit a7f3b8a Author: Fritz Obermeyer <[email protected]> Date: Tue Apr 9 21:29:29 2019 -0700 Reinstate examples/minipyro.py, forked from pyro/examples (#125) * Reinstate examples/minipyro.py, forked from pyro/examples * Add a rule for eager evaluation of (p.exp() * f).reduce(ops.add) and a failing test showing numerical instability * compute most of expectation in log-space in minipyro * handle plates? * add commit 48fa3f7 Author: Neeraj Pradhan <[email protected]> Date: Mon Apr 8 11:17:29 2019 -0700 Add Beta, Dirichlet, and Binomial distributions (#120) commit f74df0a Author: eb8680 <[email protected]> Date: Sat Apr 6 19:28:39 2019 -0700 Add rule for creating Gaussians from Affine inputs (#119) commit 8fa1c32 Author: eb8680 <[email protected]> Date: Sat Apr 6 15:21:33 2019 -0700 Add an Affine term to represent multilinear functions of real Variables (#116) commit 627711e Author: Fritz Obermeyer <[email protected]> Date: Sat Apr 6 10:09:42 2019 -0700 Support wrapping PyTorch builtin functions (#118) commit 216626c Author: Fritz Obermeyer <[email protected]> Date: Sat Apr 6 09:06:51 2019 -0700 Add a torch_tensordot operation (#117) * Add a torch_tensordot op * Fix docstrings to avoid sphinx warning commit fcb4670 Author: Fritz Obermeyer <[email protected]> Date: Fri Apr 5 10:30:03 2019 -0700 Add moment_matching interpretation + SLDS example (#115) * Sketch imm example (no inference yet) * Sketch Gaussian.moment_matching_reduce * Use moment-matching interpretation in IMM example * Rename example to slds.py * Make SLDS params more interesting * Relax assumptions regarding reduced_vars commit fd0dfe4 Author: Fritz Obermeyer <[email protected]> Date: Tue Apr 2 15:04:43 2019 -0700 Add initial sphinx docs (#114) commit 51b5489 Author: Fritz Obermeyer <[email protected]> Date: Sun Mar 31 23:14:38 2019 -0700 Add a VAE example using the monte_carlo interpretation (#95) * Sketch Monte Carlo interpretation of logaddexp reduction * Use AssociativeOp in patterns * Fix op pattern matcher * Try eager before monte_carlo * Drop ops.sample, ops.marginal * Sketch VAE example using monte carlo interpretation * Refactor, focusing on .sample() and .monte_carlo_logsumexp() methods * Fix vae example * Sketch Tensor.sample() (untested) * Fix cyclic import * Sketch Gaussian.sample() (untested) * Implement Delta.sample() * Sketch Expectation class * Sketch sampler implementations * Delete Expectation in favor of Integrate in a separate PR * Revert .sample() sketch * Update VAE example to use multi-output Functions * Fix reductions in VAE * Sketch support for multiple args in __getitem__ * Fix bugs in getitem_tensor_tensor * Add stronger tests for tensor getitem * Add support for string indexing * Simplify vae example using multi-getitem * Add stub for Integrate * Fix typo * Sketch monte_carlo registration of Gaussian-Gaussian things * Add stubs for Joint integration * Fix typos * Sketch support for multiple samples * Fix test usage of registry * Fix bugs in gaussian integral * Handle scale factors in Funsor.sample() * Use Integrate in test_samplers.py * Fix bug in Integrate; be less clever * Add implementations of gaussian-linear integrals * Add interpretation logging controlled by FUNSOR_DEBUG * Simplify debug printing * Fix lazy reduction for Joint.reduce() * Fix recursion bug * Get univariate Gaussian sampling to mostly work * Fix bug in Tensor.eager_reduce with nontrivial output * Fix output shape broadcasting in Tensor * Fix assert_close in test_samplers.py * Fix cholesky bugs * Fix bug in _trace_mm() * Fixes for examples/vae.py * Remove examples/vae.py * Revert "Remove examples/vae.py" This reverts commit bee75b9. * Use funsor.Lambda in VAE example * Add a Lambda funsor, inverse to getitem * Use lazy substitution rather than Lambda * Add --pdb argument to examples/vae.py * Add function logging and filename logging when FUNSOR_DEBUG=1 * Enable more functions to be logged * Little fixes * Fixes to support vae example * Fix comment * Revert product sample rules * WIP sketch plates * Simplify vae example (still not working) * Sketch Uncurry funsor * Sketch Uncurry-Delta-Lambda pattern * Sketch Joint-Uncurry-Delta rule * Sketch uncurry-distribution test * Change to_funsor second arg from dtype to Domain * Add Funsor.__contains__ * Use Uncurry in VAE example * Fix test_normal_uncurry * Rename Uncurry to Independent * Revert irrelevant changes * Support sampling from mixtures * Update VAE example to use Independent * Get VAE example to start working * Flake8 * Revert nan validation * Add torchvision to setup.py commit 306aca6 Author: Fritz Obermeyer <[email protected]> Date: Sun Mar 31 22:51:42 2019 -0700 Add Lambda and Independent funsors (#97) * Add a Lambda funsor, inverse to getitem * Sketch Uncurry funsor * Sketch Uncurry-Delta-Lambda pattern * Sketch Joint-Uncurry-Delta rule * Sketch uncurry-distribution test * Change to_funsor second arg from dtype to Domain * Add Funsor.__contains__ * Fix test_normal_uncurry * Rename Uncurry to Independent commit 89313ef Author: Fritz Obermeyer <[email protected]> Date: Sun Mar 31 13:40:43 2019 -0700 Refactor .unscaled_sample() interface (#113) commit 366e9e3 Author: Fritz Obermeyer <[email protected]> Date: Sun Mar 31 13:39:35 2019 -0700 Change to_funsor second arg from dtype to Domain (#112) commit bddcc2c Author: Fritz Obermeyer <[email protected]> Date: Sat Mar 30 18:15:54 2019 -0700 Support event_dim kwarg in pyro.param (#111) * Support event_dim kwarg in pyro.param * Use local-param branch of Pyro * Use pyro dev for CI commit 36e57ae Author: Fritz Obermeyer <[email protected]> Date: Fri Mar 29 13:00:36 2019 -0700 Add a working minipyro with tests (#100) * Add pristine copy of pyro/contrib/minipyro.py * First pass at fixing minipyro * First pass at transformed distributions * Add test for sampling transformed Gaussian * Add test for renaming a Gaussian variable * Add dist.LogNormal distribution and density test * Add xfailing test for LogNormal sampler * Attempt to fix minipyro.elbo * Implement negation and subtraction ops for R-N derivatives * Fix bug in log_joint.process of sample * Implement reduction along a plate dimension * Implement correct but non-monte-carlo elbo * Fix bugs in Gaussian * Implement plate reductions for Gaussian, Joint * Use Expectation(...) in elbo computation * Fix typos in elbo * Add tests for plate reduction * Use Expectation interface by default * Add initial test_minipyro.py * Add more minipyro tests * Add shape assertions to gaussian math * Refactor minipyro * Add an observation to plate test * Add more plates tests * Support sampling in funsor.minipyro commit b9cdbac Author: Fritz Obermeyer <[email protected]> Date: Fri Mar 29 11:02:00 2019 -0700 Implement plate reductions for Gaussian, Joint (#108) commit 37ce962 Author: Fritz Obermeyer <[email protected]> Date: Thu Mar 28 14:43:45 2019 -0700 Make distributions lazy when used Pyro-style (#107) commit 16a2fbb Author: eb8680 <[email protected]> Date: Wed Mar 27 18:04:50 2019 -0700 Add Contract to optimizer (#105) commit c339f1a Author: Fritz Obermeyer <[email protected]> Date: Wed Mar 27 17:57:22 2019 -0700 Implement negation and subtraction ops for R-N derivatives (#104) commit 830e430 Author: Fritz Obermeyer <[email protected]> Date: Wed Mar 27 14:58:14 2019 -0700 Implement basic transformed distributions (#103) * First pass at transformed distributions * Add test for sampling transformed Gaussian * Add test for renaming a Gaussian variable * Add dist.LogNormal distribution and density test * Add xfailing test for LogNormal sampler commit a54defa Author: eb8680 <[email protected]> Date: Wed Mar 27 14:02:34 2019 -0700 Support for pattern matching with the unification library (#78) commit 364745e Author: Fritz Obermeyer <[email protected]> Date: Tue Mar 26 19:08:23 2019 -0700 Remove modified version of minipyro (#102) commit ea7feb2 Author: Fritz Obermeyer <[email protected]> Date: Tue Mar 26 13:29:12 2019 -0700 Log function and filename when FUNSOR_DEBUG=1 (#101) * Add function logging and filename logging when FUNSOR_DEBUG=1 * Enable more functions to be logged commit 951630c Author: Fritz Obermeyer <[email protected]> Date: Tue Mar 26 00:14:21 2019 -0700 Resurrect lazy Subs funsor (again) (#99) * Sketch Monte Carlo interpretation of logaddexp reduction * Use AssociativeOp in patterns * Fix op pattern matcher * Try eager before monte_carlo * Drop ops.sample, ops.marginal * Sketch VAE example using monte carlo interpretation * Refactor, focusing on .sample() and .monte_carlo_logsumexp() methods * Fix vae example * Sketch Tensor.sample() (untested) * Fix cyclic import * Sketch Gaussian.sample() (untested) * Implement Delta.sample() * Sketch Expectation class * Sketch sampler implementations * Delete Expectation in favor of Integrate in a separate PR * Revert .sample() sketch * Update VAE example to use multi-output Functions * Fix reductions in VAE * Sketch support for multiple args in __getitem__ * Fix bugs in getitem_tensor_tensor * Add stronger tests for tensor getitem * Add support for string indexing * Simplify vae example using multi-getitem * Add stub for Integrate * Fix typo * Sketch monte_carlo registration of Gaussian-Gaussian things * Add stubs for Joint integration * Fix typos * Sketch support for multiple samples * Fix test usage of registry * Fix bugs in gaussian integral * Handle scale factors in Funsor.sample() * Use Integrate in test_samplers.py * Fix bug in Integrate; be less clever * Add implementations of gaussian-linear integrals * Add interpretation logging controlled by FUNSOR_DEBUG * Simplify debug printing * Fix lazy reduction for Joint.reduce() * Fix recursion bug * Get univariate Gaussian sampling to mostly work * Fix bug in Tensor.eager_reduce with nontrivial output * Fix output shape broadcasting in Tensor * Fix assert_close in test_samplers.py * Fix cholesky bugs * Fix bug in _trace_mm() * Fixes for examples/vae.py * Remove examples/vae.py * Add docstrings * Resurrect lazy Subs funsor (again) * Fix typo * Allow completely lazy eager_subs method commit 15b0c73 Author: Fritz Obermeyer <[email protected]> Date: Mon Mar 25 17:04:45 2019 -0700 Implement Monte Carlo interpretation of Integrate (#54) * Sketch Monte Carlo interpretation of logaddexp reduction * Use AssociativeOp in patterns * Fix op pattern matcher * Try eager before monte_carlo * Drop ops.sample, ops.marginal * Sketch VAE example using monte carlo interpretation * Refactor, focusing on .sample() and .monte_carlo_logsumexp() methods * Fix vae example * Sketch Tensor.sample() (untested) * Fix cyclic import * Sketch Gaussian.sample() (untested) * Implement Delta.sample() * Sketch Expectation class * Sketch sampler implementations * Delete Expectation in favor of Integrate in a separate PR * Revert .sample() sketch * Update VAE example to use multi-output Functions * Fix reductions in VAE * Sketch support for multiple args in __getitem__ * Fix bugs in getitem_tensor_tensor * Add stronger tests for tensor getitem * Add support for string indexing * Simplify vae example using multi-getitem * Add stub for Integrate * Fix typo * Sketch monte_carlo registration of Gaussian-Gaussian things * Add stubs for Joint integration * Fix typos * Sketch support for multiple samples * Fix test usage of registry * Fix bugs in gaussian integral * Handle scale factors in Funsor.sample() * Use Integrate in test_samplers.py * Fix bug in Integrate; be less clever * Add implementations of gaussian-linear integrals * Add interpretation logging controlled by FUNSOR_DEBUG * Simplify debug printing * Fix lazy reduction for Joint.reduce() * Fix recursion bug * Get univariate Gaussian sampling to mostly work * Fix bug in Tensor.eager_reduce with nontrivial output * Fix output shape broadcasting in Tensor * Fix assert_close in test_samplers.py * Fix cholesky bugs * Fix bug in _trace_mm() * Fixes for examples/vae.py * Remove examples/vae.py * Add docstrings * Updates per review * Revert accidental change commit d2d4c4a Author: Fritz Obermeyer <[email protected]> Date: Sat Mar 23 13:44:16 2019 -0700 Fix lazy reduction for Joint.reduce() (#94) * Fix lazy reduction for Joint.reduce() * Fix recursion bug commit 270d168 Author: Fritz Obermeyer <[email protected]> Date: Fri Mar 22 16:44:01 2019 -0700 Add interpretation logging controlled by FUNSOR_DEBUG=1 (#93) * Add interpretation logging controlled by FUNSOR_DEBUG * Simplify debug printing * Improve pretty printing of Stack and Joint commit 5d0a291 Author: Fritz Obermeyer <[email protected]> Date: Fri Mar 22 12:55:34 2019 -0700 Implement advanced indexing in Funsor.__getitem__() (#88) * Sketch support for multiple args in __getitem__ * Fix bugs in getitem_tensor_tensor * Add stronger tests for tensor getitem * Add support for string indexing commit 028f640 Author: Fritz Obermeyer <[email protected]> Date: Thu Mar 21 15:45:29 2019 -0700 Add isort command to Makefile (#92) commit 7bbfb3a Author: Fritz Obermeyer <[email protected]> Date: Thu Mar 21 13:39:40 2019 -0700 Sketched a simple PCFG example (#87) commit 3fe2581 Author: Fritz Obermeyer <[email protected]> Date: Thu Mar 21 13:39:14 2019 -0700 Refactor contract dependencies (#91) * Refactor contract dependencies * Fix optimize(Contract, Tensor, Tensor) * Fix dtype computation * Address review comment * Fix typo commit 7cca0f8 Author: eb8680 <[email protected]> Date: Wed Mar 20 12:22:44 2019 -0700 Implement Contract term (#77) commit 876070f Author: Fritz Obermeyer <[email protected]> Date: Wed Mar 20 00:19:26 2019 -0700 Add a to_data() helper (#84) * Add a to_nonfunsor() helper * Fix typo; add more tests * Rename to_nonfunsor to to_data commit 05649ae Author: Fritz Obermeyer <[email protected]> Date: Tue Mar 19 20:50:04 2019 -0700 Support torch functions that return nested tuples of tensors (#82) commit 2b8c0e5 Author: eb8680 <[email protected]> Date: Tue Mar 19 14:39:51 2019 -0700 Rename funsor.contract module to funsor.sum_product (#81) commit 0139a70 Author: Fritz Obermeyer <[email protected]> Date: Fri Mar 15 15:58:11 2019 -0700 Implement monte carlo .sample() methods (#75) commit b5ea615 Author: Fritz Obermeyer <[email protected]> Date: Fri Mar 15 15:40:08 2019 -0700 Implement sequential interpretation (#76) commit 5fa7fa6 Author: Fritz Obermeyer <[email protected]> Date: Wed Mar 13 11:29:21 2019 -0700 Implement a Joint normal form funsor (#69) * Add a simple delta distribution * Add tests for nontrivial event dim * Simplify unit test * Sketch a general Delta funsor class * Simplify to binding a single name in Delta * Add some tests for Delta * Add test for ground substitution * Add tests for reduction * Add test for conversion from dist.Delta to Delta * Sketch JointNormalForm funsor * Settle on Joint interface * Add more + handling * Remove .log_density field from Delta funsor * Drop handling of .log_density from Joint * Add logic promoting various Binary(-,-) to Joint * Revert "Remove .log_density field from Delta funsor" This reverts commit 897f523. * Revert "Drop handling of .log_density from Joint" This reverts commit a7d0082. * Simplify Gaussian funsor * WIP Refactor Joint patterns * Get Gaussian working with Joint * Add a smoke test for Joint * Add test for reduction * Make xfail more targeted * Update docstring on Joint * Remove unnecessary handling of Binary(ops.add,...) commit 9dbb231 Author: Neeraj Pradhan <[email protected]> Date: Tue Mar 12 18:46:00 2019 -0700 Separate out ops implementations based on backend (#74) * Separate out ops implementations based on backend * rebase with master * fix failing tests * fix error in safediv; get tests working * use object for binary ops * address comment * address comments commit b130f17 Author: Fritz Obermeyer <[email protected]> Date: Mon Mar 11 16:21:14 2019 -0700 Implement a general Delta funsor (#65) * Add a simple delta distribution * Add tests for nontrivial event dim * Simplify unit test * Sketch a general Delta funsor class * Simplify to binding a single name in Delta * Add some tests for Delta * Add test for ground substitution * Add tests for reduction * Add test for conversion from dist.Delta to Delta * Remove .log_density field from Delta funsor * Revert "Remove .log_density field from Delta funsor" This reverts commit 897f523. * Fix failing test * Add tests for log_density * Update __init__.py commit 34a1d9c Author: Fritz Obermeyer <[email protected]> Date: Mon Mar 11 15:53:09 2019 -0700 Implement MultivariateNormal distribution (#73) * Add multivariate distribution * Reduce test tolerance to fix CI build commit 8108b78 Author: Neeraj Pradhan <[email protected]> Date: Mon Mar 11 12:48:37 2019 -0700 Add numpy backend for funsor (#58) commit 89540d6 Author: eb8680 <[email protected]> Date: Mon Mar 11 12:43:22 2019 -0700 Add prototype funsor.adjoint module (#64) commit 27b4a76 Author: Fritz Obermeyer <[email protected]> Date: Sun Mar 10 19:38:57 2019 -0700 Make reduction methods operate over events (#66) * Make reduction ops operate over events * Update existing tests * Update examples * Update README.md * Add tests for event reduction ops * Fix shape bug * Update README.md commit db497c4 Author: eb8680 <[email protected]> Date: Sat Mar 9 19:43:27 2019 -0800 Add lazy option to HMM examples (#67) commit e46c2df Author: Fritz Obermeyer <[email protected]> Date: Sat Mar 9 01:56:27 2019 -0800 Refactor contract (#60) * Sketch funsor.contract module * Add unit test for _partition * Add tests for partial_sum_product() * Fix test in python 3 commit 97153c7 Author: Fritz Obermeyer <[email protected]> Date: Fri Mar 8 16:37:47 2019 -0800 Match Op type rather than object (#63) commit d960182 Author: Fritz Obermeyer <[email protected]> Date: Fri Mar 8 15:56:34 2019 -0800 Add type check in Funsor.__call__() (#62) commit 72fedac Author: Fritz Obermeyer <[email protected]> Date: Fri Mar 8 15:14:15 2019 -0800 Update minipyro storyboard to correctly handle plates (#56) * Update minipyro storyboard to correctly handle plates * Revert changes to einsum.py commit 52f4366 Author: Fritz Obermeyer <[email protected]> Date: Fri Mar 8 14:57:21 2019 -0800 Implement Op wrapper class to enable pattern matching (#55) commit e64a730 Author: Fritz Obermeyer <[email protected]> Date: Wed Mar 6 17:41:20 2019 -0800 Add a simple Delta distribution (#49) * Add a simple delta distribution * Add tests for nontrivial event dim * Simplify unit test commit c47a17f Author: eb8680 <[email protected]> Date: Wed Mar 6 09:12:29 2019 -0800 Fix path evaluation order in optimizer (#47) commit 4537e90 Author: eb8680 <[email protected]> Date: Tue Mar 5 18:27:36 2019 -0800 Add plated einsum implementation (#46) commit 448c1fa Author: Fritz Obermeyer <[email protected]> Date: Mon Mar 4 17:12:54 2019 -0800 Implement general Gaussian funsor (#37) * WIP sketch Gaussian funsor * Partially implement binary_gaussian_gaussian * Implement marginalization along a dimension; add smoke test * Add more comments * Implement binary_gaussian_gaussian * Sketch to_affine() and Affine funsor * Add xfailing test for to_affine() * Sketch more of eager_subs * Remove affine stuff * WIP fix align_gaussian() using align_tensor() * Refactor and simplify align_tensor() * Fix eager_subs * Get smoke tests working * Switch from scale_tril to precision representation * Implement basic Normal -> Gaussian transform * Rename normal conversions * Fix filling in of defaults for distribution classes * Add test for binary_gaussian_number * Add test for binary_gaussian_tensor * Add xfailing test for gaussian + gaussian * Add more tests * Add test of Normal vs Gaussian * Fix math error in Gaussian .logsumexp() * Fix bugs in Gaussian+Gaussian, align_gaussian() * Fix kalman_filter.py, add to make test * Add more distribution tests commit d333418 Author: eb8680 <[email protected]> Date: Sun Mar 3 10:35:23 2019 -0800 Reinstate opt_einsum-based optimizer (#40)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds
Contract
to the optimizer and parametrizes it with a sum and product op. As far as I can tell there are no performance regressions, and we should now be able to optimizeIntegrate
expressions.