-
Notifications
You must be signed in to change notification settings - Fork 0
/
AM_banana_scale.nf
53 lines (46 loc) · 1.66 KB
/
AM_banana_scale.nf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
include { crossProduct; collectCSVs; setupPigeons; head; pow; deliverables; checkGitUpdated; commit } from './utils.nf'
params.dryRun = false
def variables = [
dim: (-13..6).collect{Math.pow(2, it)},
seed: (1..20),
model: ["banana_scale"],
sampler: ["mix_autoMALA","autoMALA", "autoMALA_fixed", "NUTS"] // MALA runs alongside autoMALA
]
model_string = [
banana_scale: "Pigeons.stan_banana(1, 1/dim)",
]
sampler_string = [
autoMALA: "AutoMALA()",
autoMALA_fixed: "AutoMALA(preconditioner = Pigeons.DiagonalPreconditioner())",
mix_autoMALA: """Mix(
AutoMALA(preconditioner=Pigeons.IdentityPreconditioner(), base_n_refresh=1),
AutoMALA(preconditioner=Pigeons.MixDiagonalPreconditioner(), base_n_refresh=1),
AutoMALA(preconditioner=Pigeons.DiagonalPreconditioner(), base_n_refresh=1)
)""",
NUTS: "Pigeons.MALA()", // ignored, just use it to compile
]
n_rounds = params.dryRun ? 4 : 20
PT_n_chains = 10
def julia_env_dir = file("julia-environment")
def julia_depot_dir = file(".depot")
def deliv = deliverables(workflow)
workflow {
args = crossProduct(variables, params.dryRun)
julia_env = setupPigeons(julia_depot_dir, julia_env_dir)
agg_path = runSimulation(julia_depot_dir, julia_env, args) | collectCSVs
//commit(agg_path, params.dryRun) // cannot commit from container, priv keys not available
}
process runSimulation {
memory {4.GB * task.attempt}
time { 1.hour * task.attempt }
errorStrategy 'retry'
maxRetries '3'
input:
env JULIA_DEPOT_PATH
path julia_env
val arg
output:
tuple val(arg), path('csvs')
script:
template 'AM_scale_main.jl'
}