Skip to content

Commit f2ad863

Browse files
committed
Running but buggy AMP-BP
1 parent ba2b263 commit f2ad863

File tree

6 files changed

+316
-62
lines changed

6 files changed

+316
-62
lines changed

Manifest.toml

Lines changed: 109 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# This file is machine-generated - editing it directly is not advised
22

3-
julia_version = "1.10.0-alpha1"
3+
julia_version = "1.9.2"
44
manifest_format = "2.0"
5-
project_hash = "e6ce59a96d6c60be83224779123a46e1dfd61ecb"
5+
project_hash = "426d5ac467261afc2896c60ab2735a7aa4815844"
6+
7+
[[deps.ArgTools]]
8+
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
9+
version = "1.1.1"
610

711
[[deps.ArnoldiMethod]]
812
deps = ["LinearAlgebra", "Random", "StaticArrays"]
@@ -21,14 +25,11 @@ deps = ["UUIDs"]
2125
git-tree-sha1 = "4e88377ae7ebeaf29a047aa1ee40826e0b708a5d"
2226
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
2327
version = "4.7.0"
28+
weakdeps = ["Dates", "LinearAlgebra"]
2429

2530
[deps.Compat.extensions]
2631
CompatLinearAlgebraExt = "LinearAlgebra"
2732

28-
[deps.Compat.weakdeps]
29-
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
30-
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
31-
3233
[[deps.CompilerSupportLibraries_jll]]
3334
deps = ["Artifacts", "Libdl"]
3435
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
@@ -40,10 +41,22 @@ git-tree-sha1 = "cf25ccb972fec4e4817764d01c82386ae94f77b4"
4041
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
4142
version = "0.18.14"
4243

44+
[[deps.Dates]]
45+
deps = ["Printf"]
46+
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
47+
4348
[[deps.Distributed]]
4449
deps = ["Random", "Serialization", "Sockets"]
4550
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
4651

52+
[[deps.Downloads]]
53+
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
54+
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
55+
version = "1.6.0"
56+
57+
[[deps.FileWatching]]
58+
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
59+
4760
[[deps.Graphs]]
4861
deps = ["ArnoldiMethod", "Compat", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"]
4962
git-tree-sha1 = "1cf1d7dcb4bc32d7b4a5add4232db3750c27ecb4"
@@ -59,13 +72,35 @@ version = "0.1.3"
5972
deps = ["Markdown"]
6073
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
6174

75+
[[deps.LibCURL]]
76+
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
77+
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
78+
version = "0.6.3"
79+
80+
[[deps.LibCURL_jll]]
81+
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
82+
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
83+
version = "7.84.0+0"
84+
85+
[[deps.LibGit2]]
86+
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
87+
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
88+
89+
[[deps.LibSSH2_jll]]
90+
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
91+
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
92+
version = "1.10.2+0"
93+
6294
[[deps.Libdl]]
6395
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
6496

6597
[[deps.LinearAlgebra]]
6698
deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"]
6799
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
68100

101+
[[deps.Logging]]
102+
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
103+
69104
[[deps.MacroTools]]
70105
deps = ["Markdown", "Random"]
71106
git-tree-sha1 = "42324d08725e200c23d4dfb549e0d5d89dede2d2"
@@ -76,21 +111,53 @@ version = "0.5.10"
76111
deps = ["Base64"]
77112
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
78113

114+
[[deps.MbedTLS_jll]]
115+
deps = ["Artifacts", "Libdl"]
116+
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
117+
version = "2.28.2+0"
118+
79119
[[deps.Mmap]]
80120
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
81121

122+
[[deps.MozillaCACerts_jll]]
123+
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
124+
version = "2022.10.11"
125+
126+
[[deps.NetworkOptions]]
127+
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
128+
version = "1.2.0"
129+
82130
[[deps.OpenBLAS_jll]]
83131
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
84132
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
85-
version = "0.3.23+0"
133+
version = "0.3.21+4"
86134

87135
[[deps.OrderedCollections]]
88136
git-tree-sha1 = "d321bf2de576bf25ec4d3e4360faca399afca282"
89137
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
90138
version = "1.6.0"
91139

140+
[[deps.Pkg]]
141+
deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
142+
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
143+
version = "1.9.2"
144+
145+
[[deps.Printf]]
146+
deps = ["Unicode"]
147+
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
148+
149+
[[deps.ProgressMeter]]
150+
deps = ["Distributed", "Printf"]
151+
git-tree-sha1 = "d7a7aef8f8f2d537104f170139553b14dfe39fe9"
152+
uuid = "92933f4c-e287-5a05-a399-4b506db050ca"
153+
version = "1.7.2"
154+
155+
[[deps.REPL]]
156+
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
157+
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
158+
92159
[[deps.Random]]
93-
deps = ["SHA"]
160+
deps = ["SHA", "Serialization"]
94161
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
95162

96163
[[deps.SHA]]
@@ -120,9 +187,8 @@ version = "1.4.0"
120187
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
121188

122189
[[deps.SparseArrays]]
123-
deps = ["Libdl", "LinearAlgebra", "Random", "Serialization"]
190+
deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"]
124191
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
125-
version = "1.10.0"
126192

127193
[[deps.StaticArrays]]
128194
deps = ["LinearAlgebra", "Random", "StaticArraysCore"]
@@ -144,11 +210,44 @@ deps = ["LinearAlgebra", "SparseArrays"]
144210
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
145211
version = "1.9.0"
146212

213+
[[deps.SuiteSparse_jll]]
214+
deps = ["Artifacts", "Libdl", "Pkg", "libblastrampoline_jll"]
215+
uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c"
216+
version = "5.10.1+6"
217+
218+
[[deps.TOML]]
219+
deps = ["Dates"]
220+
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
221+
version = "1.0.3"
222+
223+
[[deps.Tar]]
224+
deps = ["ArgTools", "SHA"]
225+
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
226+
version = "1.10.0"
227+
147228
[[deps.UUIDs]]
148229
deps = ["Random", "SHA"]
149230
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
150231

232+
[[deps.Unicode]]
233+
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
234+
235+
[[deps.Zlib_jll]]
236+
deps = ["Libdl"]
237+
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
238+
version = "1.2.13+0"
239+
151240
[[deps.libblastrampoline_jll]]
152241
deps = ["Artifacts", "Libdl"]
153242
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
154243
version = "5.8.0+0"
244+
245+
[[deps.nghttp2_jll]]
246+
deps = ["Artifacts", "Libdl"]
247+
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
248+
version = "1.48.0+0"
249+
250+
[[deps.p7zip_jll]]
251+
deps = ["Artifacts", "Libdl"]
252+
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
253+
version = "17.4.0+0"

Project.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ version = "0.1.0"
66
[deps]
77
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
88
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
9+
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
910
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1011
SimpleWeightedGraphs = "47aef6b3-ad0c-573a-a1e2-d07658019622"
1112
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
13+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1214

1315
[compat]
1416
Graphs = "1.8"
@@ -20,7 +22,9 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
2022
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
2123
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
2224
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
25+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
26+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
2327
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2428

2529
[targets]
26-
test = ["Aqua", "Documenter", "JET", "JuliaFormatter", "Test"]
30+
test = ["Aqua", "Documenter", "JET", "JuliaFormatter", "Random", "Statistics", "Test"]
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
module StochasticBlockModelVariants
22

3-
using Base
4-
using Graphs: AbstractGraph
3+
using Base: RefValue
4+
using Graphs: AbstractGraph, has_edge, neighbors
55
using LinearAlgebra: Symmetric, dot
6+
using ProgressMeter: @showprogress
67
using Random: AbstractRNG, default_rng
7-
using SimpleWeightedGraphs: SimpleWeightedGraph
8-
using SparseArrays: SparseMatrixCSC, sparse
8+
using SimpleWeightedGraphs: SimpleWeightedGraph, SimpleWeightedDiGraph
9+
using Statistics: mean
10+
using SparseArrays: SparseMatrixCSC, sparse, findnz
911

1012
export ContextualSBM, ContextualSBMLatents, ContextualSBMObservations
13+
export affinities, effective_snr
14+
export init_amp, update_amp!, run_amp, evaluate_amp
1115

16+
include("utils.jl")
1217
include("contextual_sbm.jl")
1318

1419
end

0 commit comments

Comments
 (0)