Skip to content

Commit 9fe2797

Browse files
committed
Remove Artifacts.toml from main project
and, instead, add it to the test project. The new Artifacts.toml includes problems for all 4 tasks, which are MAR, MPE, MMAP, and PR.
1 parent 75db0d1 commit 9fe2797

File tree

15 files changed

+47
-103
lines changed

15 files changed

+47
-103
lines changed

Artifacts.toml

Lines changed: 0 additions & 34 deletions
This file was deleted.

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ authors = ["Jin-Guo Liu", "Martin Roa Villescas"]
44
version = "0.1.0"
55

66
[deps]
7-
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
87
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
98
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
109
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
@@ -16,7 +15,6 @@ TropicalGEMM = "a4ad3063-64a7-4bad-8738-34ed09bc0236"
1615
TropicalNumbers = "b3a74e9c-7526-4576-a4eb-79c0d4c32334"
1716

1817
[compat]
19-
Artifacts = "1"
2018
CUDA = "4"
2119
DocStringExtensions = "0.8.6, 0.9"
2220
OMEinsum = "0.7"

benchmark/bench_map.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ using Artifacts
66

77
const SUITE = BenchmarkGroup()
88

9-
problem = read_uai_problem("Promedus_14")
9+
model_filepath, evid_filepath, sol_filepath = get_instance_filepaths("Promedus_14", "MAR")
10+
problem = uai_problem_from_file(model_filepath; uai_evid_filepath = evid_filepath, uai_mar_filepath = sol_filepath)
1011

1112
optimizer = TreeSA(ntrials = 1, niters = 2, βs = 1:0.1:40)
1213
tn = TensorNetworkModel(problem; optimizer)

benchmark/bench_mar.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ using Artifacts
88

99
const SUITE = BenchmarkGroup()
1010

11-
problem = read_uai_problem("Promedus_14")
11+
model_filepath, evid_filepath, sol_filepath = get_instance_filepaths("Promedus_14", "MAR")
12+
problem = uai_problem_from_file(model_filepath; uai_evid_filepath = evid_filepath, uai_mar_filepath = sol_filepath)
1213

1314
optimizer = TreeSA(ntrials = 1, niters = 5, βs = 0.1:0.1:100)
1415
tn1 = TensorNetworkModel(problem; optimizer)

benchmark/bench_mmap.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ using Artifacts
66

77
const SUITE = BenchmarkGroup()
88

9-
problem = read_uai_problem("Promedus_14")
9+
model_filepath, evid_filepath, sol_filepath = get_instance_filepaths("Promedus_14", "MAR")
10+
problem = uai_problem_from_file(model_filepath; uai_evid_filepath = evid_filepath, uai_mar_filepath = sol_filepath)
1011
optimizer = TreeSA(ntrials = 1, niters = 2, βs = 1:0.1:40)
1112

1213
# Does not marginalize any var

src/Core.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,6 @@ end
4141
$TYPEDSIGNATURES
4242
4343
Set the evidence of an UAI instance.
44-
45-
### Examples
46-
```jldoctest; setup=:(using TensorInference)
47-
julia> problem = read_uai_problem("Promedus_14"); problem.obsvars, problem.obsvals
48-
([42, 48, 27, 30, 29, 15, 124, 5, 148], [1, 1, 1, 1, 1, 1, 1, 1, 1])
49-
50-
julia> set_evidence!(problem, 2=>0, 4=>1); problem.obsvars, problem.obsvals
51-
([2, 4], [0, 1])
52-
```
5344
"""
5445
function set_evidence!(uai::UAIInstance, pairs::Pair{Int}...)
5546
empty!(uai.obsvars)

src/TensorInference.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ module TensorInference
22

33
using OMEinsum, LinearAlgebra
44
using DocStringExtensions, TropicalNumbers
5-
using Artifacts
65
# The Tropical GEMM support
76
using TropicalGEMM
87
using StatsBase
@@ -12,7 +11,7 @@ export RescaledArray
1211
export contraction_complexity, TreeSA, GreedyMethod, KaHyParBipartite, SABipartite, MergeGreedy, MergeVectors
1312

1413
# read and load uai files
15-
export read_uai_file, read_td_file, read_uai_evid_file, read_uai_mar_file, read_uai_problem, uai_problem_from_file
14+
export read_uai_file, read_td_file, read_uai_evid_file, read_uai_mar_file, uai_problem_from_file
1615
export set_evidence!
1716

1817
# marginals

src/utils.jl

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,18 +175,6 @@ end
175175
"""
176176
$(TYPEDSIGNATURES)
177177
178-
Read a UAI problem from an artifact.
179-
"""
180-
function read_uai_problem(problem::AbstractString; eltype = Float64)::UAIInstance
181-
uai_filepath = joinpath(artifact"MAR_prob", problem * ".uai")
182-
uai_evid_filepath = joinpath(artifact"MAR_prob", problem * ".uai.evid")
183-
uai_mar_filepath = joinpath(artifact"MAR_sol", problem * ".uai.MAR")
184-
return uai_problem_from_file(uai_filepath; uai_evid_filepath, uai_mar_filepath, eltype)
185-
end
186-
187-
"""
188-
$(TYPEDSIGNATURES)
189-
190178
Read a UAI problem from a file.
191179
"""
192180
function uai_problem_from_file(uai_filepath::String; uai_evid_filepath::String = "", uai_mar_filepath::String = "", eltype = Float64)::UAIInstance

test/Artifacts.toml

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,6 @@
1-
[MAR_prob]
2-
git-tree-sha1 = "4dd2447ab2b8eeb8fbfc35d0c7416b5f01ff9711"
1+
[uai2014]
2+
git-tree-sha1 = "5d2c17ee6ad8e89f046b370e865780dea89e4268"
33

4-
[[MAR_prob.download]]
5-
sha256 = "857f8b6706dad46698c6e90a1804e1b40633d87f6eb3d82b5f29929bb6f5155a"
6-
url = "https://personal.utdallas.edu/~vibhav.gogate/uai14-competition/files/MAR_prob.tar.gz"
7-
8-
[MAR_sol]
9-
git-tree-sha1 = "8a86826145efa6b7d7d9c837acd80e33d1368f37"
10-
11-
[[MAR_sol.download]]
12-
sha256 = "d8616ebfc1ab538c2957919f8bb47bd9c1fb86392dd025585cde041bc4e0e934"
13-
url = "https://personal.utdallas.edu/~vibhav.gogate/uai14-competition/files/MAR_sol.tar.gz"
14-
15-
[MMAP_UAI2014]
16-
git-tree-sha1 = "869778bbf5214cbff2169ecc2f3e67e2cb1b6a7a"
17-
18-
[[MMAP_UAI2014.download]]
19-
sha256 = "0080c4851e23c17a42262cdaf4cb1a7aa4b80674435756d0d1ade76d80b9f33f"
20-
url = "https://personal.utdallas.edu/~vibhav.gogate/uai14-competition/files/MMAP_UAI2014.tar.gz"
21-
22-
[PR_prob]
23-
git-tree-sha1 = "a9baff14cc5f64a5d95920928581e2b4eb82acd3"
24-
25-
[[PR_prob.download]]
26-
sha256 = "20b38d43a0718ab555988f041069380a30bbb68881e60d07ebf004054eb9f14f"
27-
url = "https://personal.utdallas.edu/~vibhav.gogate/uai14-competition/files/PR_prob.tar.gz"
28-
29-
[PR_sol]
30-
git-tree-sha1 = "e6643155c4ee433d20ddb7e58441b33b35ecacb8"
31-
32-
[[PR_sol.download]]
33-
sha256 = "86b37c0e7c83f6ff162c88d48250e0bf2b7dd73d44441074ae93a81986238436"
34-
url = "https://personal.utdallas.edu/~vibhav.gogate/uai14-competition/files/PR_sol.tar.gz"
4+
[[uai2014.download]]
5+
sha256 = "22dff6d2b27f5e78b315e4c756c24a0fb9e476c8e814a2546d7f61822426b08a"
6+
url = "https://github.com/mroavi/uai-2014-inference-competition/raw/main/uai2014.tar.gz"

test/cuda.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ CUDA.allowscalar(false)
55

66
@testset "gradient-based tensor network solvers" begin
77
################# Load problem ####################
8-
instance = read_uai_problem("Promedus_14")
8+
model_filepath, evid_filepath, sol_filepath = get_instance_filepaths("Promedus_14", "MAR")
9+
instance = uai_problem_from_file(model_filepath; uai_evid_filepath = evid_filepath, uai_mar_filepath = sol_filepath)
910

1011
# does not optimize over open vertices
1112
tn = TensorNetworkModel(instance; optimizer = TreeSA(ntrials = 1, niters = 2, βs = 1:0.1:40))
@@ -22,7 +23,8 @@ end
2223

2324
@testset "map" begin
2425
################# Load problem ####################
25-
instance = read_uai_problem("Promedus_14")
26+
model_filepath, evid_filepath, sol_filepath = get_instance_filepaths("Promedus_14", "MAR")
27+
instance = uai_problem_from_file(model_filepath; uai_evid_filepath = evid_filepath, uai_mar_filepath = sol_filepath)
2628

2729
# does not optimize over open vertices
2830
tn = TensorNetworkModel(instance; optimizer = TreeSA(ntrials = 1, niters = 2, βs = 1:0.1:40))
@@ -37,7 +39,8 @@ end
3739

3840
@testset "mmap" begin
3941
################# Load problem ####################
40-
instance = read_uai_problem("Promedus_14")
42+
model_filepath, evid_filepath, sol_filepath = get_instance_filepaths("Promedus_14", "MAR")
43+
instance = uai_problem_from_file(model_filepath; uai_evid_filepath = evid_filepath, uai_mar_filepath = sol_filepath)
4144

4245
optimizer = TreeSA(ntrials = 1, niters = 2, βs = 1:0.1:40)
4346
tn_ref = TensorNetworkModel(instance; optimizer)

0 commit comments

Comments
 (0)