Amortised adaptive importance sampling
Organizations: University of Edinburgh
Abstract
Monte Carlo sampling algorithms aim to produce samples from a target distribution with a given unnormalised probability density function. The high cost of running Monte Carlo algorithms, with many simulation steps or particles needed to obtain a good empirical approximation to the target, can be reduced by introducing learnable components into the sampler -- a form of amortisation. Once these components are trained, amortised samplers can produce high-quality samples with less computation at sampling time than training-free algorithms would require. We propose an amortised sampler built upon the framework of adaptive importance sampling -- a hierarchical importance sampling procedure where the proposal is iteratively adapted. Our amortised adaptive importance sampling algorithm fits a lightweight neural network that adapts the proposal using information obtained over the course of sampling. By training our sampler over many different targets taken from the same family of distributions, we obtain a sampler that can adapt to a specific target at sampling time without a priori access to the target's parameters. We show that our procedure can efficiently sample from targets within the family the sampler was trained on, giving improvements over target-specific amortised samplers and training-free adaptive importance sampling algorithms. We also explore the potential for generalisation, where the trained sampler is used to sample from targets outwith its training family.
Figures & tables
| Method Metric | sliced | ESS | err. | |
|---|---|---|---|---|
| AAIS | 0.4658 0.002 (0.978) | 0.2605 0.008 (0.015) | 0.1250 0.005 (0.241) | |
| DM-PMC | 0.9592 (1.69) | 0.0301 (0.002) | 0.2691 (0.537) | |
| M-PMC | 0.7222 (1.43) | 0.0965 (0.004) | 0.1777 (0.347) | |
| GAPIS | 1.678 (2.44) | 0.0055 (0.001) | 0.4400 (1.05) | |
| True samples | 0.4451 (0.848) | 1.000 (1.00) | 0.0000 (0.000) | |
| AAIS | 0.5069 0.006 (1.08) | 0.1953 0.006 (0.003) | 0.2672 0.007 (0.413) |
| Method Metric | sliced | ESS | err. | |
|---|---|---|---|---|
| AAIS | 0.8718 0.029 (1.50) | 0.0358 0.003 (0.002) | 0.5812 0.007 (0.972) | |
| DM-PMC | 1.594 (3.16) | 0.0120 (0.001) | 0.8585 (1.69) | |
| M-PMC | 2.005 (4.31) | 0.0081 (0.000) | 1.674 (3.81) | |
| GAPIS | 138.7 (543.3) | 0.0016 (0.000) | 2.449 (5.90) | |
| True samples | 0.3458 (0.565) | 1.000 (1.00) | 0.0000 (0.000) | |
| AAIS | 0.9877 0.020 (2.41) | 0.0125 0.001 (0.001) | 1.279 0.022 (2.19) |
| Target Family | Amortised over | Evaluated on | err. |
|---|---|---|---|
| Funnel | Single target | Single target | |
| Family | |||
| Single target | Family | ||
| Family | |||
| Banana | Single target | Single target | |
| Family |
| Base Target | Shift Method | AAIS | DM-PMC | M-PMC | GAPIS |
|---|---|---|---|---|---|
| Banana ( ) | Curvature range: | ( ) | ( ) | ( ) | |
| Curvature range: | ( ) | ( ) | ( ) | ||
| BLR ( ) | |||||
| 6.793 (16.909) | 13.203 (22.528) | 684.2 | |||
| range: | |||||
| range: |
| Target Family | Objective Metric | err. |
|---|---|---|
| Funnel | ||
| (SNIS) | ||
| (oracle draws) | ||
| Banana | ||
| (SNIS) | ||
| (oracle draws) |
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
| Feature | Dimension |
|---|---|
| – the pooled particle encodings. | |
| , position relative to the ensemble. | |
| , variance relative to the ensemble. | |
| Correlations of . | |
| – EM mass share. | |
| – Current mixture weight multiplied by . |
| Target Family | (AAIS) | (DM-PMC) | (M-PMC) | (GAPIS) | (GAPIS) | H | Num. params. | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| BLR d5 | 5 | 10 | 15 | 15 | 32 | 32 | 25 | 1e-05 | 3.0 | 32 | 5802 |
| Hierarchical d5 | 5 | 10 | 15 | 15 | 32 | 32 | 25 | 1e-05 | 1.0 | 32 | 5802 |
| Funnel d5 | 5 | 10 | 15 | 15 | 32 | 32 | 25 | 0.01 | 1.0 | 32 | 5802 |
| Banana d5 | 5 | 10 | 15 | 15 | 32 | 32 | 25 | 0.03 | 1.0 | 32 | 5802 |
| BLR d25 | 25 | 25 | 15 | 15 | 32 | 32 | 6 | 1e-05 | 3.0 | 64 | 31346 |
| Hierarchical d25 | 25 | 25 | 15 | 15 | 32 | 32 | 6 | 1e-05 | 1.0 | 64 | 31346 |
| Target Family | Method Metric | sliced | rev. KL | err. | err. |
|---|---|---|---|---|---|
| BLR | With gradient features | ||||
| No gradient features | |||||
| Hierarchical | With gradient features | ||||
| No gradient features | |||||
| Funnel | With gradient features | ||||
| No gradient features |
| Target Family | Method Metric | sliced | rev. KL | err. | err. |
|---|---|---|---|---|---|
| BLR | With EM features | ||||
| No EM features | |||||
| Hierarchical | With EM features | ||||
| No EM features | |||||
| Funnel | With EM features | ||||
| No EM features |
| Target Family | Method Metric | sliced | rev. KL | err. | err. |
|---|---|---|---|---|---|
| BLR | Full model | ||||
| Terminal objective only | |||||
| Step-wise | |||||
| Hierarchical | Full model | ||||
| Terminal objective only | |||||
| Step-wise |
| Target Family | Method Metric | sliced | rev. KL | err. | err. |
|---|---|---|---|---|---|
| BLR | |||||
| (SNIS) | |||||
| (oracle draws) | |||||
| Hierarchical | |||||
| (SNIS) | - | - | - | - | |
| (oracle draws) | - | - | - | - |
| Target Family | Method Metric | sliced | rev. KL | err. | err. |
|---|---|---|---|---|---|
| BLR | Diagonal | ||||
| Isotropic | |||||
| Full | |||||
| Hierarchical | Diagonal | ||||
| Isotropic ∗ | |||||
| Full |
| Target Family | Method Metric | sliced | rev. KL | err. | err. |
|---|---|---|---|---|---|
| BLR | Scale-equivariant | ||||
| Not scale-equivariant | |||||
| Hierarchical | Scale-equivariant | ||||
| Not scale-equivariant | |||||
| Funnel | Scale-equivariant | ||||
| Not scale-equivariant |
| Base Target | Shift Method | Equivariant | Non-equivariant |
|---|---|---|---|
| Banana ( ) | Curvature range: | ||
| Curvature range: | |||
| BLR ( ) | |||
| range: | |||
| range: |
| Target Family | Hidden dim. Metric | sliced | rev. KL | err. | err. |
|---|---|---|---|---|---|
| BLR | |||||
| Hierarchical | |||||
| Trained on Evaluated on | Banana | BLR | Funnel | Hierarchical | |
|---|---|---|---|---|---|
| Banana | ( ) | ( ) | ( ) | ( ) | |
| BLR | ( ) | ( ) | ( ) | ( ) | |
| Funnel | ( ) | ( ) | ( ) | ( ) | |
| Hierarchical | ( ) | ( ) | ( ) | ( ) | |
| Banana | 1.093 | 1.045 | |||
| BLR |
| Method Metric | sliced | sliced | rev. KL | ESS | err. | err. | err. | |
|---|---|---|---|---|---|---|---|---|
| AAIS | 0.4658 0.002 (0.978) | 0.5919 0.004 (1.21) | 0.1224 0.003 (0.194) | 0.2605 0.008 (0.015) | 0.1250 0.005 (0.241) | 0.3619 0.006 (1.07) | 70.126 0.267 (246.6) | |
| DM-PMC | 0.9592 (1.69) | 0.9823 (1.83) | 11.360 (31.36) | 0.0301 (0.002) | 0.2691 (0.537) | 0.5487 (1.31) | 83.221 (267.1) | |
| M-PMC | 0.7222 (1.43) | 0.7588 (1.57) | 0.7444 (1.52) | 0.0965 (0.004) | 0.1777 (0.347) | 0.5617 (1.43) | 78.737 (258.9) | |
| GAPIS | 1.678 (2.44) | 1.425 (2.44) | ( ) | 0.0055 (0.001) | 0.4400 (1.05) | 0.9232 (1.94) | 71.511 (259.7) | |
| True samples | 0.4451 (0.848) | 0.5206 (0.967) | 0.0000 (0.000) | 1.000 (1.00) | 0.0000 (0.000) | 0.1113 (0.241) | 15.528 (73.76) | |
| AAIS | 0.5069 0.006 (1.08) | 0.5561 0.008 (1.16) | 0.1535 0.003 (0.238) | 0.1953 0.006 (0.003) | 0.2672 0.007 (0.413) | 0.6550 0.124 (2.13) | 428.2 7.106 ( ) |
| Method Metric | sliced | sliced | rev. KL | ESS | err. | err. | err. | |
|---|---|---|---|---|---|---|---|---|
| AAIS | 0.5072 0.004 (1.13) | 0.5685 0.016 (1.25) | 0.4092 0.008 (0.867) | 0.1301 0.003 (0.006) | 0.1988 0.011 (0.453) | 0.9676 0.029 (2.44) | 9.373 0.085 (27.18) | |
| DM-PMC | 0.7214 (1.38) | 0.6353 (1.35) | 3.493 (6.80) | 0.0466 (0.003) | 0.2104 (0.473) | 0.9608 (2.17) | 9.273 (27.58) | |
| M-PMC | 0.5467 (1.25) | 0.5637 (1.27) | 2.151 (6.55) | 0.0619 (0.002) | 0.2597 (0.688) | 0.9823 (2.41) | 8.910 (25.39) | |
| GAPIS | 1.214 (1.69) | 0.9583 (1.57) | 162.3 (675.6) | 0.0053 (0.001) | 0.5060 (1.09) | 1.207 (2.30) | 6.848 (22.08) | |
| True samples | 0.2041 (0.339) | 0.2487 (0.408) | 0.0000 (0.000) | 1.000 (1.00) | 0.0000 (0.000) | 0.0610 (0.117) | 0.4696 (1.55) | |
| AAIS | 1.093 0.007 (1.49) | 1.275 0.011 (1.90) | 6.112 0.056 (7.82) | 0.0032 0.000 (0.000) | 2.127 0.014 (3.34) | 4.295 0.023 (6.51) | 70.088 0.358 (113.7) |
| Method Metric | sliced | sliced | rev. KL | ESS | err. | err. | err. | |
|---|---|---|---|---|---|---|---|---|
| Learnt | ||||||||
| DM-PMC | ||||||||
| M-PMC | ||||||||
| GAPIS | ||||||||
| True samples | ||||||||
| Learnt |
| Method Metric | sliced | sliced | rev. KL | ESS | err. | err. | err. | |
|---|---|---|---|---|---|---|---|---|
| AAIS | 0.7489 0.027 (2.39) | 0.7158 0.031 (2.41) | 25.102 1.016 (90.71) | 0.0140 0.001 (0.000) | 21.971 1.398 (85.87) | 1.869 0.081 (6.14) | 3.852 0.125 (17.16) | |
| DM-PMC | 1.099 (2.20) | 0.7844 (2.07) | ( ) | 0.0005 (0.000) | 14.359 (54.53) | 1.419 (4.65) | 3.311 (11.96) | |
| M-PMC | 2.263 (4.17) | 2.223 (4.18) | 114.1 (262.1) | 0.0016 (0.000) | 111.3 (257.0) | 5.941 (11.14) | 30.751 (91.58) | |
| GAPIS | 34.469 (163.6) | 2.999 (4.71) | ( ) | 0.0003 (0.000) | 69.437 (144.8) | 5.895 (10.22) | 30.323 (75.57) | |
| True samples | 0.0169 (0.030) | 0.0199 (0.036) | 0.0000 (0.000) | 1.000 (1.00) | 0.0000 (0.000) | 0.0048 (0.011) | 0.0104 (0.027) | |
| AAIS | 1.174 0.033 (2.60) | 1.091 0.044 (2.49) | 409.9 3.154 ( ) | 0.0004 0.000 (0.000) | 374.4 4.126 (994.0) | 6.832 0.265 (15.64) | 33.606 5.746 (140.9) |
| Method Metric | sliced | sliced | rev. KL | ESS | err. | err. | err. | |
|---|---|---|---|---|---|---|---|---|
| AAIS | 0.8718 0.029 (1.50) | 1.077 0.017 (2.23) | 1.120 0.021 (1.43) | 0.0358 0.003 (0.002) | 0.5812 0.007 (0.972) | 1.678 0.066 (4.08) | 39.313 1.213 (94.82) | |
| DM-PMC | 1.594 (3.16) | 1.650 (3.33) | 81.933 (316.4) | 0.0120 (0.001) | 0.8585 (1.69) | 2.575 (6.85) | 62.201 (182.2) | |
| M-PMC | 2.005 (4.31) | 1.999 (3.93) | 10.592 (28.46) | 0.0081 (0.000) | 1.674 (3.81) | 3.707 (9.78) | 68.642 (187.8) | |
| GAPIS | 138.7 (543.3) | 4.140 (8.03) | ( ) | 0.0016 (0.000) | 2.449 (5.90) | 6.160 (14.54) | 86.651 (242.6) | |
| True samples | 0.3458 (0.565) | 0.4084 (0.665) | 0.0000 (0.000) | 1.000 (1.00) | 0.0000 (0.000) | 0.0900 (0.182) | 1.432 (4.17) | |
| AAIS | 0.9877 0.020 (2.41) | 1.201 0.028 (3.01) | 2.157 0.016 (3.14) | 0.0125 0.001 (0.001) | 1.279 0.022 (2.19) | 4.531 0.077 (12.81) | 193.4 1.506 (763.2) |
| Target Family | Amortised over | Evaluated on | sliced | rev. KL | err. | err. |
|---|---|---|---|---|---|---|
| Banana | Single-target | Single-target | ||||
| Family | ||||||
| Single-target | Family | |||||
| Family | ||||||
| Funnel | Single-target | Single-target | ||||
| Family |