Skip to content

Commit

Permalink
Dev (#102)
Browse files Browse the repository at this point in the history
* Updating causal-cmd Dockerfile 1.11.1

* Updating trilearn to fix but in trilearn_pgibbs.
  • Loading branch information
felixleopoldo authored Nov 30, 2023
1 parent 395bcdd commit 3754a47
Show file tree
Hide file tree
Showing 21 changed files with 87 additions and 44 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.0
2.6.1
67 changes: 55 additions & 12 deletions config/chordal_algos.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"data": [
{
"data_id": "example1",
"graph_id": "cta",
"graph_id": "AR1-5",
"parameters_id": "intra-class",
"seed_range": [
1,
5
1
]
}
],
Expand All @@ -21,7 +21,7 @@
"path": true,
"text": false,
"ids": [
"gg99"
"gg99", "trilearn"
]
},
"graph_true_plots": true,
Expand All @@ -33,27 +33,43 @@
"mcmc_traj_plots": [
{
"id": "gg99",
"burn_in": 0,
"thinning": 10,
"burn_in": 0.5,
"thinning": 1000,
"functional": [
"score",
"size"
],
"active": true
},
{
"id": "trilearn",
"burn_in": 0.5,
"thinning": 1,
"functional": [
"score",
"size"
],
"active": true
}

],
"mcmc_heatmaps": [
{
"id": "gg99",
"burn_in": 0.5,
"active": true
},
{
"id": "trilearn",
"burn_in": 0.5,
"active": true
}
],
"mcmc_autocorr_plots": [
{
"id": "gg99",
"burn_in": 0.5,
"thinning": 100,
"thinning": 1000,
"lags": 50,
"functional": [
"score",
Expand Down Expand Up @@ -81,13 +97,13 @@
{
"id": "AR1-5",
"max_bandwidth": 5,
"dim": 10000
"dim": 50
}
],
"trilearn_cta": [
{
"id": "cta",
"order": 100,
"order": 50,
"alpha": 0.5,
"beta": 0.5
}
Expand All @@ -114,12 +130,18 @@
{
"id": "gg99",
"burnin_frac": 0.5,
"mcmc_estimator": "map",
"mcmc_estimator": "threshold",
"timeout": null,
"threshold": 0.5,
"mcmc_seed": [1, 2, 3],
"threshold": [0.2, 0.5, 0.9],
"mcmc_seed": [
1,
2,
3
],
"num_samples": 1000000,
"sampler": [0, 1],
"sampler": [
1
],
"edge_penalty": 1.0,
"size_maxclique": 10000
}
Expand Down Expand Up @@ -147,6 +169,27 @@
"mcmc_estimator": "map",
"timeout": null
}
],
"trilearn_pgibbs": [
{
"id": "trilearn",
"datatype": "continuous",
"alpha": 0.5,
"beta": 0.5,
"radii": 80,
"n_particles": 20,
"M": 2000,
"pseudo_obs": 1,
"mcmc_seed": [1,2,3],
"mcmc_estimator": "threshold",
"threshold": [
0.2,
0.5,
0.9
],
"burnin_frac": 0.5,
"timeout": null
}
]
}
}
Expand Down
18 changes: 9 additions & 9 deletions docs/source/available_graphs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ Below is a list of available modules.
* - Band matrix
- `DG <https://en.wikipedia.org/wiki/Chordal_graph>`__
- `trilearn <https://github.com/felixleopoldo/trilearn>`__
- 1.25
- 2.0.4
- trilearn_bandmat_
* - CTA
- `DG <https://en.wikipedia.org/wiki/Chordal_graph>`__
- `trilearn <https://github.com/felixleopoldo/trilearn>`__
- 1.25
- 2.0.4
- trilearn_cta_
* - Random bandmatrix
- `DG <https://en.wikipedia.org/wiki/Chordal_graph>`__
- `trilearn <https://github.com/felixleopoldo/trilearn>`__
- 1.25
- 2.0.4
- trilearn_rand_bandmat_


Expand Down Expand Up @@ -206,7 +206,7 @@ trilearn_bandmat
* - Package
- `trilearn <https://github.com/felixleopoldo/trilearn>`__
* - Version
- 1.25
- 2.0.4
* - Language
- `Python <https://www.python.org/>`__
* - Docs
Expand All @@ -216,7 +216,7 @@ trilearn_bandmat
* - Graph type
- `DG <https://en.wikipedia.org/wiki/Chordal_graph>`__
* - Docker
- `bpimages/trilearn:2.0.3 <https://hub.docker.com/r/bpimages/trilearn/tags>`__
- `bpimages/trilearn:2.0.4.0 <https://hub.docker.com/r/bpimages/trilearn/tags>`__

* - Module
- `trilearn_bandmat <https://github.com/felixleopoldo/benchpress/tree/master/workflow/rules/graph/trilearn_bandmat>`__
Expand Down Expand Up @@ -260,7 +260,7 @@ trilearn_cta
* - Package
- `trilearn <https://github.com/felixleopoldo/trilearn>`__
* - Version
- 1.25
- 2.0.4
* - Language
- `Python <https://www.python.org/>`__
* - Docs
Expand All @@ -270,7 +270,7 @@ trilearn_cta
* - Graph type
- `DG <https://en.wikipedia.org/wiki/Chordal_graph>`__
* - Docker
- `bpimages/trilearn:2.0.3 <https://hub.docker.com/r/bpimages/trilearn/tags>`__
- `bpimages/trilearn:2.0.4.0 <https://hub.docker.com/r/bpimages/trilearn/tags>`__

* - Module
- `trilearn_cta <https://github.com/felixleopoldo/benchpress/tree/master/workflow/rules/graph/trilearn_cta>`__
Expand Down Expand Up @@ -319,7 +319,7 @@ trilearn_rand_bandmat
* - Package
- `trilearn <https://github.com/felixleopoldo/trilearn>`__
* - Version
- 1.25
- 2.0.4
* - Language
- `Python <https://www.python.org/>`__
* - Docs
Expand All @@ -329,7 +329,7 @@ trilearn_rand_bandmat
* - Graph type
- `DG <https://en.wikipedia.org/wiki/Chordal_graph>`__
* - Docker
- `bpimages/trilearn:2.0.3 <https://hub.docker.com/r/bpimages/trilearn/tags>`__
- `bpimages/trilearn:2.0.4.0 <https://hub.docker.com/r/bpimages/trilearn/tags>`__

* - Module
- `trilearn_rand_bandmat <https://github.com/felixleopoldo/benchpress/tree/master/workflow/rules/graph/trilearn_rand_bandmat>`__
Expand Down
4 changes: 2 additions & 2 deletions docs/source/available_parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ trilearn_hyper-dir
* - Graph type
- `DG <https://en.wikipedia.org/wiki/Chordal_graph>`__
* - Docker
- `bpimages/trilearn:2.0.3 <https://hub.docker.com/r/bpimages/trilearn/tags>`__
- `bpimages/trilearn:2.0.4.0 <https://hub.docker.com/r/bpimages/trilearn/tags>`__
* - Module
- `trilearn_hyper-dir <https://github.com/felixleopoldo/benchpress/tree/master/workflow/rules/parameters/trilearn_hyper-dir>`__

Expand Down Expand Up @@ -345,7 +345,7 @@ trilearn_intra-class
* - Graph type
- `UG <https://en.wikipedia.org/wiki/Graph_(discrete_mathematics)#Graph>`__
* - Docker
- `bpimages/trilearn:2.0.3 <https://hub.docker.com/r/bpimages/trilearn/tags>`__
- `bpimages/trilearn:2.0.4.0 <https://hub.docker.com/r/bpimages/trilearn/tags>`__
* - Module
- `trilearn_intra-class <https://github.com/felixleopoldo/benchpress/tree/master/workflow/rules/parameters/trilearn_intra-class>`__

Expand Down
4 changes: 2 additions & 2 deletions docs/source/available_structure_learning_algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4213,7 +4213,7 @@ trilearn_pgibbs
* - Package
- `trilearn <https://github.com/felixleopoldo/trilearn>`__
* - Version
- 1.25
- 2.0.4
* - Language
- `Python <https://www.python.org/>`__
* - Docs
Expand All @@ -4223,7 +4223,7 @@ trilearn_pgibbs
* - Graph type
- `DG <https://en.wikipedia.org/wiki/Chordal_graph>`__
* - Docker
- `bpimages/trilearn:2.0.3 <https://hub.docker.com/r/bpimages/trilearn/tags>`__
- `bpimages/trilearn:2.0.4.0 <https://hub.docker.com/r/bpimages/trilearn/tags>`__

* - Module folder
- `trilearn_pgibbs <https://github.com/felixleopoldo/benchpress/tree/master/workflow/rules/structure_learning_algorithms/trilearn_pgibbs>`__
Expand Down
2 changes: 1 addition & 1 deletion workflow/envs/Dockerfile.causal-cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM r-base:4.1.0
RUN apt update -y
RUN apt install -y default-jre
WORKDIR /tetrad
RUN wget https://s01.oss.sonatype.org/content/repositories/releases/io/github/cmu-phil/causal-cmd/1.11.0/causal-cmd-1.11.0-jar-with-dependencies.jar
RUN wget https://s01.oss.sonatype.org/content/repositories/releases/io/github/cmu-phil/causal-cmd/1.11.1/causal-cmd-1.11.1-jar-with-dependencies.jar
RUN apt install time

RUN R -e 'install.packages("remotes")'
Expand Down
2 changes: 1 addition & 1 deletion workflow/envs/Dockerfile.trilearn
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ FROM python:3.11.5
RUN apt update -y
RUN apt install -y graphviz libgraphviz-dev
RUN apt install time
RUN pip install trilearn==2.0.3
RUN pip install trilearn==2.0.4
6 changes: 3 additions & 3 deletions workflow/envs/build_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ declare -A image_versions
# image_versions[pcalg]=2.7-8
# image_versions[bnlearn]=4.8.3
# image_versions[bidag]=2.1.4
# image_versions[causal-cmd]=1.11.0
# image_versions[causal-cmd]=1.11.1
# image_versions[equsa_psilearner]=1.2.1
# image_versions[benchpress]=2.1.0
# image_versions[causaldag]=0.1a163
# image_versions[gcastle]=1.0.3
# image_versions[sandbox]=1.0
# image_versions[datascience-python]=1.1
# image_versions[trilearn]=2.0.3
image_versions[trilearn]=2.0.4.0
# image_versions[snakemake]=v7.32.3
# image_versions[gobnilp]=4347c64
image_versions[grues]=0.3.0
# image_versions[grues]=0.3.0

# Build the image for amd64 and arm64 and push them to dockerhub and create the manifest and push it
# Run this twice or so as some packages depend on rgraphstuff and pcalg e.g.
Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/docker_images.smk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

def docker_image(name):
if name == "trilearn":
return "docker://bpimages/trilearn:2.0.3"
return "docker://bpimages/trilearn:2.0.4.0"
elif name == "pydatascience":
return "docker://bpimages/datascience-python:1.1"
elif name == "bidag":
Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/graph/trilearn_bandmat/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Band matrix",
"version": "1.25",
"version": "2.0.4",
"package": {
"title": "trilearn",
"url": "https://github.com/felixleopoldo/trilearn"
Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/graph/trilearn_bandmat/rule.smk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ rule trilearn_bandmat:
output:
adjmat = "{output_dir}/adjmat/" + pattern_strings["trilearn_bandmat"] + "/seed={seed}.csv"
container:
"docker://bpimages/trilearn:2.0.3"
"docker://bpimages/trilearn:2.0.4.0"
shell:
"python workflow/rules/graph/trilearn_bandmat/trilearn_gen_bandmat.py {output.adjmat} {wildcards.seed} {wildcards.dim} {wildcards.bandwidth}"
2 changes: 1 addition & 1 deletion workflow/rules/graph/trilearn_cta/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "CTA",
"version": "1.25",
"version": "2.0.4",
"package": {
"title": "trilearn",
"url": "https://github.com/felixleopoldo/trilearn"
Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/graph/trilearn_cta/rule.smk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ rule sample_adjmat_cta:
output:
adjmat = "{output_dir}/adjmat/" + pattern_strings["trilearn_cta"] + "/seed={seed}.csv"
container:
"docker://bpimages/trilearn:2.0.3"
"docker://bpimages/trilearn:2.0.4.0"
shell:
"python workflow/rules/graph/trilearn_cta/trilearn_sample_cta.py {output.adjmat} {wildcards.seed} {wildcards.order} {wildcards.alpha} {wildcards.beta} "
2 changes: 1 addition & 1 deletion workflow/rules/graph/trilearn_rand_bandmat/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Random bandmatrix",
"version": "1.25",
"version": "2.0.4",
"package": {
"title": "trilearn",
"url": "https://github.com/felixleopoldo/trilearn"
Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/graph/trilearn_rand_bandmat/rule.smk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ rule trilearn_rand_bandmat:
output:
adjmat = "{output_dir}/adjmat/" + pattern_strings["trilearn_rand_bandmat"] + "/seed={seed}.csv"
container:
"docker://bpimages/trilearn:2.0.3"
"docker://bpimages/trilearn:2.0.4.0"
shell:
"python workflow/rules/graph/trilearn_rand_bandmat/trilearn_rand_bandmat.py {output.adjmat} {wildcards.seed} {wildcards.dim} {wildcards.max_bandwidth}"
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
np.random.seed(seed)
g = dlib.sample_random_AR_graph(dim, max_bandwidth)

m = nx.to_numpy_matrix(g)
m = nx.to_numpy_array(g)
df = pd.DataFrame(m, dtype=int)
df.to_csv(filename, index=None)
2 changes: 1 addition & 1 deletion workflow/rules/parameters/trilearn_g_inv_wishart/rule.smk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ rule trilearn_g_inv_wishart:
"seed={seed}/"+\
"adjmat=/{adjmat}.csv"
container:
"docker://bpimages/trilearn:2.0.3"
"docker://bpimages/trilearn:2.0.4.0"
shell:
"python workflow/rules/parameters/trilearn_g_in_wishart/trilearn_g_inv_wishart_cov.py {input.adjmat} {output.params} {wildcards.dof} {wildcards.seed}"
2 changes: 1 addition & 1 deletion workflow/rules/parameters/trilearn_hyper-dir/rule.smk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ rule trilearn_hyper_dir:
"seed={seed}/"+\
"adjmat=/{adjmat}.json"
container:
"docker://bpimages/trilearn:2.0.3"
"docker://bpimages/trilearn:2.0.4.0"
shell:
"python workflow/rules/parameters/trilearn_hyper-dir/trilearn_sample_hyper-dir.py {output.bn} {wildcards.seed} {wildcards.n_levels} {wildcards.pseudo_obs} {input.adjmat}"
2 changes: 1 addition & 1 deletion workflow/rules/parameters/trilearn_intra-class/rule.smk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ rule intra_class_cov:
"seed={seed}/"+\
"adjmat=/{adjmat}.csv"
container:
"docker://bpimages/trilearn:2.0.3"
"docker://bpimages/trilearn:2.0.4.0"
shell:
"python workflow/rules/parameters/trilearn_intra-class/trilearn_g_intra_class_cov.py {input.adjmat} {output.params} {wildcards.rho} {wildcards.sigma2}"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Particle Gibbs",
"version": "1.25",
"version": "2.0.4",
"package": {
"title": "trilearn",
"url": "https://github.com/felixleopoldo/trilearn"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ rule:
time=alg_output_time_path(module_name),
ntests=touch(alg_output_ntests_path(module_name))
container:
"docker://bpimages/trilearn:2.0.3"
"docker://bpimages/trilearn:2.0.4.0"
shell:
"""
if [ {wildcards.timeout} = \"None\" ]; then
Expand Down

0 comments on commit 3754a47

Please sign in to comment.