Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: TuringLang/Bijectors.jl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.12.0
Choose a base ref
...
head repository: TuringLang/Bijectors.jl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 4,071 additions and 1,902 deletions.
  1. +2 −0 .JuliaFormatter.toml
  2. +7 −0 .github/dependabot.yml
  3. +18 −9 .github/workflows/AD.yml
  4. +1 −1 .github/workflows/CompatHelper.yml
  5. +49 −0 .github/workflows/DocNav.yml
  6. +2 −2 .github/workflows/Docs.yml
  7. +1 −1 .github/workflows/DocsPreviewCleanup.yml
  8. +38 −0 .github/workflows/Format.yml
  9. +13 −9 .github/workflows/Interface.yml
  10. +17 −0 .github/workflows/TagBot.yml
  11. +2 −2 .gitignore
  12. +47 −10 Project.toml
  13. +6 −474 README.md
  14. +11 −6 docs/make.jl
  15. +5 −2 docs/src/distributions.md
  16. +17 −17 docs/src/examples.md
  17. +31 −21 docs/src/index.md
  18. +3 −3 docs/src/transforms.md
  19. +92 −0 ext/BijectorsDistributionsADExt.jl
  20. +217 −0 ext/BijectorsEnzymeCoreExt.jl
  21. +9 −4 src/compat/forwarddiff.jl → ext/BijectorsForwardDiffExt.jl
  22. +16 −0 ext/BijectorsLazyArraysExt.jl
  23. +34 −0 ext/BijectorsMooncakeExt.jl
  24. +269 −0 ext/BijectorsReverseDiffExt.jl
  25. +108 −110 src/compat/tracker.jl → ext/BijectorsTrackerExt.jl
  26. +57 −131 src/compat/zygote.jl → ext/BijectorsZygoteExt.jl
  27. +182 −115 src/Bijectors.jl
  28. +385 −55 src/bijectors/corr.jl
  29. +24 −17 src/bijectors/coupling.jl
  30. +6 −1 src/bijectors/exp_log.jl
  31. +2 −0 src/bijectors/leaky_relu.jl
  32. +8 −4 src/bijectors/logit.jl
  33. +26 −21 src/bijectors/named_bijector.jl
  34. +22 −25 src/bijectors/normalise.jl
  35. +102 −20 src/bijectors/ordered.jl
  36. +43 −20 src/bijectors/pd.jl
  37. +5 −6 src/bijectors/permute.jl
  38. +10 −5 src/bijectors/planar_layer.jl
  39. +66 −0 src/bijectors/product_bijector.jl
  40. +13 −8 src/bijectors/radial_layer.jl
  41. +38 −46 src/bijectors/rational_quadratic_spline.jl
  42. +29 −0 src/bijectors/reshape.jl
  43. +4 −1 src/bijectors/scale.jl
  44. +4 −1 src/bijectors/shift.jl
  45. +95 −112 src/bijectors/simplex.jl
  46. +132 −45 src/bijectors/stacked.jl
  47. +38 −5 src/bijectors/truncated.jl
  48. +143 −13 src/chainrules.jl
  49. +0 −78 src/compat/distributionsad.jl
  50. +0 −189 src/compat/reversediff.jl
  51. +120 −4 src/interface.jl
  52. +109 −24 src/transformed_distribution.jl
  53. +163 −0 src/utils.jl
  54. +22 −3 test/Project.toml
  55. +91 −1 test/ad/chainrules.jl
  56. +35 −0 test/ad/corr.jl
  57. +51 −0 test/ad/enzyme.jl
  58. +29 −0 test/ad/pd.jl
  59. +38 −0 test/ad/stacked.jl
  60. +105 −17 test/ad/utils.jl
  61. +83 −0 test/bijectors/corr.jl
  62. +10 −18 test/bijectors/coupling.jl
  63. +2 −2 test/bijectors/leaky_relu.jl
  64. +12 −12 test/bijectors/named_bijector.jl
  65. +122 −17 test/bijectors/ordered.jl
  66. +37 −0 test/bijectors/pd.jl
  67. +7 −7 test/bijectors/permute.jl
  68. +69 −0 test/bijectors/product_bijector.jl
  69. +48 −2 test/bijectors/rational_quadratic_spline.jl
  70. +9 −0 test/bijectors/reshape.jl
  71. +77 −0 test/bijectors/stacked.jl
  72. +30 −9 test/bijectors/utils.jl
  73. +7 −0 test/distributionsad.jl
  74. +118 −61 test/interface.jl
  75. +16 −14 test/norm_flows.jl
  76. +25 −3 test/runtests.jl
  77. +187 −119 test/transform.jl
2 changes: 2 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
style="blue"
format_markdown=true
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
27 changes: 18 additions & 9 deletions .github/workflows/AD.yml
Original file line number Diff line number Diff line change
@@ -6,33 +6,42 @@ on:
- master
pull_request:

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.version == 'nightly' }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
- 'min'
- '1'
os:
- ubuntu-latest
- macOS-latest
arch:
- x64
AD:
- Enzyme
- ForwardDiff
- Mooncake
- Tracker
- ReverseDiff
- Zygote
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4

- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest

- uses: julia-actions/julia-buildpkg@v1

- uses: julia-actions/julia-runtest@v1
continue-on-error: ${{ matrix.AD == 'Enzyme' && matrix.version == '1' }}
env:
GROUP: AD
AD: ${{ matrix.AD }}
2 changes: 1 addition & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -14,5 +14,5 @@ jobs:
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main(; subdirs = ["", "test"])'
49 changes: 49 additions & 0 deletions .github/workflows/DocNav.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Add Navbar

on:
page_build: # Triggers the workflow on push events to gh-pages branch
workflow_dispatch: # Allows manual triggering
schedule:
- cron: '0 0 * * 0' # Runs every week on Sunday at midnight (UTC)

jobs:
add-navbar:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages
fetch-depth: 0

- name: Download insert_navbar.sh
run: |
curl -O https://raw.githubusercontent.com/TuringLang/turinglang.github.io/main/assets/scripts/insert_navbar.sh
chmod +x insert_navbar.sh
- name: Update Navbar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
# Define the URL of the navbar to be used
NAVBAR_URL="https://raw.githubusercontent.com/TuringLang/turinglang.github.io/main/assets/scripts/TuringNavbar.html"
# Update all HTML files in the current directory (gh-pages root)
./insert_navbar.sh . $NAVBAR_URL
# Remove the insert_navbar.sh file
rm insert_navbar.sh
# Check if there are any changes
if [[ -n $(git status -s) ]]; then
git add .
git commit -m "Added navbar and removed insert_navbar.sh"
git push "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" gh-pages
else
echo "No changes to commit"
fi
4 changes: 2 additions & 2 deletions .github/workflows/Docs.yml
Original file line number Diff line number Diff line change
@@ -18,8 +18,8 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- name: Install dependencies
2 changes: 1 addition & 1 deletion .github/workflows/DocsPreviewCleanup.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Delete preview and history + push changes
38 changes: 38 additions & 0 deletions .github/workflows/Format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Format

on:
push:
branches:
- master
pull_request:
branches:
- master
merge_group:
types: [checks_requested]

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: 1
- name: Format code
run: |
using Pkg
Pkg.add(; name="JuliaFormatter", uuid="98e50ef6-434e-11e9-1051-2b60c6c9e899")
using JuliaFormatter
format("."; verbose=true)
shell: julia --color=yes {0}
- uses: reviewdog/action-suggester@v1
if: github.event_name == 'pull_request'
with:
tool_name: JuliaFormatter
fail_on_error: true
22 changes: 13 additions & 9 deletions .github/workflows/Interface.yml
Original file line number Diff line number Diff line change
@@ -7,27 +7,31 @@ on:
- master
pull_request:

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.version == 'nightly' }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
- 'min'
- 'lts'
- '1'
os:
- ubuntu-latest
- macOS-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
GROUP: Interface
17 changes: 17 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -4,6 +4,22 @@ on:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: 3
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
@@ -12,3 +28,4 @@ jobs:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/Manifest.toml
/test/Manifest.toml
Manifest.toml
docs/build
57 changes: 47 additions & 10 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name = "Bijectors"
uuid = "76274a88-744f-5084-9051-94815aaf08c4"
version = "0.12.0"
version = "0.15.4"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112"
IrrationalConstants = "92d709cd-6900-40b7-9082-c6be49f344b6"
@@ -16,23 +16,60 @@ LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
MappedArrays = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[weakdeps]
DistributionsAD = "ced4e74d-a319-5a8a-b0ac-84af2272839c"
EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[extensions]
BijectorsDistributionsADExt = "DistributionsAD"
BijectorsEnzymeCoreExt = "EnzymeCore"
BijectorsForwardDiffExt = "ForwardDiff"
BijectorsLazyArraysExt = "LazyArrays"
BijectorsMooncakeExt = "Mooncake"
BijectorsReverseDiffExt = "ReverseDiff"
BijectorsTrackerExt = "Tracker"
BijectorsZygoteExt = "Zygote"

[compat]
ArgCheck = "1, 2"
ChainRulesCore = "0.10.11, 1"
ChangesOfVariables = "0.1"
Compat = "3, 4"
Distributions = "0.23.3, 0.24, 0.25"
Functors = "0.1, 0.2, 0.3, 0.4"
Distributions = "0.25.33"
DistributionsAD = "0.6"
DocStringExtensions = "0.9"
EnzymeCore = "0.8.4"
ForwardDiff = "0.10"
Functors = "0.1, 0.2, 0.3, 0.4, 0.5"
InverseFunctions = "0.1"
IrrationalConstants = "0.1"
IrrationalConstants = "0.1, 0.2"
LazyArrays = "2"
LogExpFunctions = "0.3.3"
MappedArrays = "0.2.2, 0.3, 0.4"
Mooncake = "0.4.19"
Reexport = "0.2, 1"
Requires = "0.5, 1"
Roots = "1.3.4, 2"
julia = "1.6"
ReverseDiff = "1"
Roots = "1.3.15, 2"
Statistics = "1"
Tracker = "0.2"
Zygote = "0.6.63, 0.7"
julia = "1.10"

[extras]
DistributionsAD = "ced4e74d-a319-5a8a-b0ac-84af2272839c"
EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
Loading