Skip to content

Commit

Permalink
Merge pull request #22 from JaimeRZP/L_tuning
Browse files Browse the repository at this point in the history
bump
  • Loading branch information
JaimeRZP authored Sep 17, 2024
2 parents e1766de + d35e0fd commit 5c2ee80
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 1,052 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,5 @@ jobs:
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
2 changes: 1 addition & 1 deletion Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.3"
manifest_format = "2.0"
project_hash = "8d5d365aa071b44ea9dddeccf081ff5d62da916a"
project_hash = "935d687a10c1a19be0208d8dae9a8a293a5d389d"

[[deps.ADTypes]]
git-tree-sha1 = "99a6f5d0ce1c7c6afdb759daa30226f71c54f6b0"
Expand Down
3 changes: 1 addition & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MicroCanonicalHMC"
uuid = "234d2aa0-2291-45f7-9047-6fa6f316b0a8"
authors = ["Jaime Ruiz Zapatero <[email protected]>", "Marco Bonici", "Marius Millea"]
version = "0.1.6"
version = "0.1.7"

[deps]
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
Expand Down Expand Up @@ -33,4 +33,3 @@ MCMCChains = "6.0"
MCMCDiagnosticTools = "0.3"
ProgressMeter = "1.9"
Statistics = "1.8, 1.9"
julia = "1.9"
1,001 changes: 48 additions & 953 deletions examples/Gaussian/Gaussian.ipynb

Large diffs are not rendered by default.

26 changes: 1 addition & 25 deletions examples/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.3"
manifest_format = "2.0"
project_hash = "f17aa7ba2fe12643b9915fc244fc2af1ca233917"
project_hash = "55badaeabc08148fc4bc961f208c0b09ba8bb64d"

[[deps.ADTypes]]
git-tree-sha1 = "99a6f5d0ce1c7c6afdb759daa30226f71c54f6b0"
Expand Down Expand Up @@ -301,12 +301,6 @@ weakdeps = ["InverseFunctions", "Test"]
ChangesOfVariablesInverseFunctionsExt = "InverseFunctions"
ChangesOfVariablesTestExt = "Test"

[[deps.CodeTracking]]
deps = ["InteractiveUtils", "UUIDs"]
git-tree-sha1 = "7eee164f122511d3e4e1ebadb7956939ea7e1c77"
uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
version = "1.3.6"

[[deps.ColorTypes]]
deps = ["FixedPointNumbers", "Random"]
git-tree-sha1 = "b10d0b65641d57b8b4d5e234446582de5047050d"
Expand Down Expand Up @@ -810,12 +804,6 @@ git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.21.4"

[[deps.JuliaInterpreter]]
deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"]
git-tree-sha1 = "2984284a8abcfcc4784d95a9e2ea4e352dd8ede7"
uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
version = "0.9.36"

[[deps.KernelAbstractions]]
deps = ["Adapt", "Atomix", "InteractiveUtils", "MacroTools", "PrecompileTools", "Requires", "StaticArrays", "UUIDs", "UnsafeAtomics", "UnsafeAtomicsLLVM"]
git-tree-sha1 = "cb1cff88ef2f3a157cbad75bbe6b229e1975e498"
Expand Down Expand Up @@ -1027,12 +1015,6 @@ git-tree-sha1 = "c1dd6d7978c12545b4179fb6153b9250c96b0075"
uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36"
version = "1.0.3"

[[deps.LoweredCodeUtils]]
deps = ["JuliaInterpreter"]
git-tree-sha1 = "c2b5e92eaf5101404a58ce9c6083d595472361d6"
uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
version = "3.0.2"

[[deps.MCMCChains]]
deps = ["AbstractMCMC", "AxisArrays", "Dates", "Distributions", "IteratorInterfaceExtensions", "KernelDensity", "LinearAlgebra", "MCMCDiagnosticTools", "MLJModelInterface", "NaturalSort", "OrderedCollections", "PrettyTables", "Random", "RecipesBase", "Statistics", "StatsBase", "StatsFuns", "TableTraits", "Tables"]
git-tree-sha1 = "d28056379864318172ff4b7958710cfddd709339"
Expand Down Expand Up @@ -1584,12 +1566,6 @@ git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7"
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "1.3.0"

[[deps.Revise]]
deps = ["CodeTracking", "Distributed", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "REPL", "Requires", "UUIDs", "Unicode"]
git-tree-sha1 = "7b7850bb94f75762d567834d7e9802fc22d62f9c"
uuid = "295af30f-e4ad-537b-8983-00126c2a3abe"
version = "3.5.18"

[[deps.Rmath]]
deps = ["Random", "Rmath_jll"]
git-tree-sha1 = "852bd0f55565a9e973fcfee83a84413270224dc4"
Expand Down
82 changes: 16 additions & 66 deletions examples/Neals Funnel/Neals_funnel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,74 +38,24 @@
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[32m\u001b[1mPrecompiling\u001b[22m\u001b[39m Turing\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mLogDensityProblemsAD → LogDensityProblemsADTrackerExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mArrayInterface → ArrayInterfaceTrackerExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mAdvancedMH\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mAdvancedPS\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mNamedDims → TrackerExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mManifoldDiff → ManifoldDiffForwardDiffExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mRecursiveArrayTools → RecursiveArrayToolsForwardDiffExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mBijectors → BijectorsTrackerExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mNLSolversBase\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mEllipticalSliceSampling\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mAdvancedPS → AdvancedPSLibtaskExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mDistributionsAD → DistributionsADTrackerExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39mAdvancedHMC\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mRecursiveArrayTools → RecursiveArrayToolsTrackerExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mAdvancedMH → AdvancedMHMCMCChainsExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mLineSearches\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mAdvancedVI\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mAdvancedMH → AdvancedMHForwardDiffExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mAdvancedHMC → AdvancedHMCMCMCChainsExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mAdvancedMH → AdvancedMHStructArraysExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mOptim\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mManifolds\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mManifolds → ManifoldsRecipesBaseExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mManifolds → ManifoldsTestExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mSymbolicUtils\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mSymbolicLimits\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mSymbolics\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mSymbolics → SymbolicsForwardDiffExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mSymbolicAnalysis\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mOptimizationBase\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mOptimizationBase → OptimizationFiniteDiffExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mOptimizationBase → OptimizationForwardDiffExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mOptimizationBase → OptimizationTrackerExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mOptimization\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mOptimizationOptimJL\u001b[39m\n",
"\u001b[32m ✓ \u001b[39mTuring\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mTuring → TuringOptimExt\u001b[39m\n",
" 37 dependencies successfully precompiled in 56 seconds. 288 already precompiled.\n",
"\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mPrecompiling Turing [fce5fe82-541a-59a6-adf8-730c64b5f9a0]\n",
"\u001b[33m\u001b[1m┌ \u001b[22m\u001b[39m\u001b[33m\u001b[1mWarning: \u001b[22m\u001b[39mattempting to remove probably stale pidfile\n",
"\u001b[33m\u001b[1m│ \u001b[22m\u001b[39m path = \"/home/jaimerz/.julia/compiled/v1.10/DSP/OtML7_dGBoG.ji.pidfile\"\n",
"\u001b[33m\u001b[1m└ \u001b[22m\u001b[39m\u001b[90m@ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.3+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:244\u001b[39m\n",
"\u001b[32m\u001b[1mPrecompiling\u001b[22m\u001b[39m TuringOptimExt\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mManifolds → ManifoldsRecipesBaseExt\u001b[39m\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mTuring → TuringOptimExt\u001b[39m\n",
" 2 dependencies successfully precompiled in 129 seconds. 323 already precompiled.\n",
" 2 dependencies successfully precompiled in 120 seconds. 323 already precompiled.\n",
"\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mPrecompiling TuringOptimExt [cd2420fc-8d31-5c39-8d98-0365cfcf7d6e]\n",
"\u001b[33m\u001b[1m┌ \u001b[22m\u001b[39m\u001b[33m\u001b[1mWarning: \u001b[22m\u001b[39mModule Turing with build ID fafbfcfd-7a31-5a40-0000-091f843b7c5c is missing from the cache.\n",
"\u001b[33m\u001b[1m┌ \u001b[22m\u001b[39m\u001b[33m\u001b[1mWarning: \u001b[22m\u001b[39mModule Turing with build ID fafbfcfd-2439-c66c-0000-0be7a3c0590a is missing from the cache.\n",
"\u001b[33m\u001b[1m│ \u001b[22m\u001b[39mThis may mean Turing [fce5fe82-541a-59a6-adf8-730c64b5f9a0] does not support precompilation but is imported by a module that does.\n",
"\u001b[33m\u001b[1m└ \u001b[22m\u001b[39m\u001b[90m@ Base loading.jl:1948\u001b[39m\n",
"\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mSkipping precompilation since __precompile__(false). Importing TuringOptimExt [cd2420fc-8d31-5c39-8d98-0365cfcf7d6e].\n",
"\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mPrecompiling PyPlot [d330b81b-6aea-500a-939a-2ce795aea3ee]\n",
"\u001b[32m\u001b[1mPrecompiling\u001b[22m\u001b[39m SciMLBasePyCallExt\n",
"\u001b[32m ✓ \u001b[39m\u001b[90mSciMLBase → SciMLBasePyCallExt\u001b[39m\n",
" 1 dependency successfully precompiled in 8 seconds. 130 already precompiled.\n",
"\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mPrecompiling SciMLBasePyCallExt [d083c4ab-32a5-5342-b289-e118b48fb79d]\n",
"\u001b[33m\u001b[1m┌ \u001b[22m\u001b[39m\u001b[33m\u001b[1mWarning: \u001b[22m\u001b[39mModule PyCall with build ID fafbfcfd-2831-d97a-0000-095cd54ed228 is missing from the cache.\n",
"\u001b[33m\u001b[1m│ \u001b[22m\u001b[39mThis may mean PyCall [438e738f-606a-5dbb-bf0a-cddfbfd45ab0] does not support precompilation but is imported by a module that does.\n",
"\u001b[33m\u001b[1m└ \u001b[22m\u001b[39m\u001b[90m@ Base loading.jl:1948\u001b[39m\n",
"\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mSkipping precompilation since __precompile__(false). Importing SciMLBasePyCallExt [d083c4ab-32a5-5342-b289-e118b48fb79d].\n",
"\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mPrecompiling ManifoldsRecipesBaseExt [37da849e-34ab-54fd-a5a4-b22599bd6cb0]\n",
"\u001b[33m\u001b[1m┌ \u001b[22m\u001b[39m\u001b[33m\u001b[1mWarning: \u001b[22m\u001b[39mModule Manifolds with build ID fafbfcfd-8f45-8415-0000-0934cd8bedc5 is missing from the cache.\n",
"\u001b[33m\u001b[1m│ \u001b[22m\u001b[39mThis may mean Manifolds [1cead3c2-87b3-11e9-0ccd-23c62b72b94e] does not support precompilation but is imported by a module that does.\n",
"\u001b[33m\u001b[1m└ \u001b[22m\u001b[39m\u001b[90m@ Base loading.jl:1948\u001b[39m\n",
"\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mSkipping precompilation since __precompile__(false). Importing ManifoldsRecipesBaseExt [37da849e-34ab-54fd-a5a4-b22599bd6cb0].\n",
"\u001b[32m\u001b[1mPrecompiling\u001b[22m\u001b[39m MicroCanonicalHMC\n",
"\u001b[32m ✓ \u001b[39mMicroCanonicalHMC\n",
" 1 dependency successfully precompiled in 2 seconds. 182 already precompiled.\n",
" 1 dependency successfully precompiled in 1 seconds. 182 already precompiled.\n",
"\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mPrecompiling MicroCanonicalHMC [234d2aa0-2291-45f7-9047-6fa6f316b0a8]\n",
"\u001b[33m\u001b[1m┌ \u001b[22m\u001b[39m\u001b[33m\u001b[1mWarning: \u001b[22m\u001b[39mModule ForwardDiff with build ID fafbfcfd-0c66-9b9a-0000-091f8f588ea0 is missing from the cache.\n",
"\u001b[33m\u001b[1m┌ \u001b[22m\u001b[39m\u001b[33m\u001b[1mWarning: \u001b[22m\u001b[39mModule ForwardDiff with build ID fafbfcfd-44a5-26b4-0000-0be7ae539a92 is missing from the cache.\n",
"\u001b[33m\u001b[1m│ \u001b[22m\u001b[39mThis may mean ForwardDiff [f6369f11-7733-5829-9624-2563aa707210] does not support precompilation but is imported by a module that does.\n",
"\u001b[33m\u001b[1m└ \u001b[22m\u001b[39m\u001b[90m@ Base loading.jl:1948\u001b[39m\n",
"\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mSkipping precompilation since __precompile__(false). Importing MicroCanonicalHMC [234d2aa0-2291-45f7-9047-6fa6f316b0a8].\n"
Expand All @@ -121,8 +71,8 @@
"using PyPlot\n",
"using Distributions\n",
"\n",
"using Revise\n",
"using MicroCanonicalHMCus"
"#using Revise\n",
"using MicroCanonicalHMC"
]
},
{
Expand Down Expand Up @@ -232,16 +182,16 @@
"\u001b[33m\u001b[1m│ \u001b[22m\u001b[39m - To prevent this behaviour, do `ProgressMeter.ijulia_behavior(:append)`. \n",
"\u001b[33m\u001b[1m│ \u001b[22m\u001b[39m - To disable this warning message, do `ProgressMeter.ijulia_behavior(:clear)`.\n",
"\u001b[33m\u001b[1m└ \u001b[22m\u001b[39m\u001b[90m@ ProgressMeter ~/.julia/packages/ProgressMeter/kVZZH/src/ProgressMeter.jl:594\u001b[39m\n",
"\u001b[32mTuning: 100%|███████████████████████████████████████████| Time: 0:00:37\u001b[39m\n",
"\u001b[32mTuning: 100%|███████████████████████████████████████████| Time: 0:00:34\u001b[39m\n",
"\u001b[34m ϵ: 2.2082187218625116\u001b[39m\n",
"\u001b[34m L: 8643.332536685335\u001b[39m\n",
"\u001b[34m dE/d: 0.0026255357025957793\u001b[39m\n",
"\u001b[32mSampling: 100%|█████████████████████████████████████████| Time: 0:00:00\u001b[39m\n"
"\u001b[32mSampling: 100%|█████████████████████████████████████████| Time: 0:00:02\u001b[39m\n"
]
}
],
"source": [
"samples = sample(funnel_model, espl, 10_000);"
"samples = sample(funnel_model, espl, 50_000);"
]
},
{
Expand Down Expand Up @@ -288,7 +238,7 @@
],
"source": [
"target = TuringTarget(funnel_model)\n",
"ssamples = Sample(mchmc, target, 100_000)"
"ssamples = Sample(mchmc, target, 50_000)"
]
},
{
Expand Down Expand Up @@ -323,7 +273,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"id": "191958da",
"metadata": {},
"outputs": [],
Expand All @@ -333,7 +283,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"id": "919c8b29",
"metadata": {},
"outputs": [],
Expand All @@ -354,7 +304,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 14,
"id": "0c724724",
"metadata": {},
"outputs": [],
Expand Down
24 changes: 22 additions & 2 deletions examples/Project.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
[deps]
AdvancedHMC = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d"
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
DynamicPPL = "366bfd00-2699-11ea-058f-f148b4cae6d8"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LogDensityProblems = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c"
LogDensityProblemsAD = "996a588d-648d-4e1f-a8f0-a84b347e47b1"
MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d"
MCMCDiagnosticTools = "be115224-59cd-429b-ad48-344e309966f0"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
MicroCanonicalHMC = "234d2aa0-2291-45f7-9047-6fa6f316b0a8"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"

[compat]
AbstractMCMC = "4.4, 5"
Adapt = "3, 4"
Distributions = "0.25"
ForwardDiff = "0.10"
HDF5 = "0.17"
LogDensityProblems = "2.1"
LogDensityProblemsAD = "1.6"
MCMCChains = "6.0"
MCMCDiagnosticTools = "0.3"
ProgressMeter = "1.9"
Statistics = "1.8, 1.9"
2 changes: 1 addition & 1 deletion test/models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
@test m1 1.00 atol = 0.2
@test s1 1.00 atol = 0.3
@test mm2 1.13 atol = 0.2
@test m2 1.97 atol = 0.2
@test m2 2.0 atol = 0.25
@test s2 2.40 atol = 0.5
end

Expand Down

0 comments on commit 5c2ee80

Please sign in to comment.