Skip to content
This repository was archived by the owner on Sep 28, 2024. It is now read-only.

Commit 6b3bb4b

Browse files
committed
result visualization (failed)
1 parent 14ee136 commit 6b3bb4b

File tree

1 file changed

+42
-11
lines changed
  • example/DoublePendulum/notebook

1 file changed

+42
-11
lines changed

example/DoublePendulum/notebook/data.jl

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,56 @@ begin
1414
end
1515

1616
# ╔═╡ 5268feee-bda2-4612-9d4c-a1db424a11c7
17-
data = get_data(i=0, n=-1)
17+
data = DoublePendulum.get_data(i=0, n=-1)[:, end-2048+1:end]
1818

19-
# ╔═╡ 9c8b3f8a-1b85-4c32-a416-ead51b244b94
19+
# ╔═╡ 4d0b08a4-8a54-41fd-997f-ad54d4c984cd
20+
m = DoublePendulum.get_model()
21+
22+
# ╔═╡ 794374ce-6674-481d-8a3b-04db0f32d233
2023
begin
21-
anim = @animate for i in 1:1000
22-
scatter(legend=false, xlim=(0, 1), ylim=(0, 1))
23-
scatter!(data[[1, 3, 5], i], data[[2, 4, 6], i], color=[:red, :green, :blue])
24-
annotate!(0.1, 0.1, text("i=$i", :left))
24+
n = 10
25+
26+
ground_truth_data = 1 .- data[:, 1+n:1024+n]
27+
28+
inferenced_data = m(reshape(data[:, 1:1024], 1, 6, :, 1))
29+
for i in 1:n
30+
inferenced_data = m(inferenced_data)
2531
end
26-
27-
gif(anim, fps=10)
32+
inferenced_data = 1 .- reshape(inferenced_data, 6, :)
2833
end
2934

30-
# ╔═╡ 4a1ebdfe-2524-4d3e-b4ab-520af315063f
35+
# ╔═╡ 9c8b3f8a-1b85-4c32-a416-ead51b244b94
36+
begin
37+
anim = @animate for i in 1:4:1024
38+
scatter(legend=false, xlim=(0, 1), ylim=(-0.5, 1), size=(600, 500))
39+
scatter!(
40+
inferenced_data[[2, 4, 6], i], inferenced_data[[1, 3, 5], i],
41+
color=[
42+
RGB([239, 71, 111]/255...),
43+
RGB([6, 214, 160]/255...),
44+
RGB([17, 138, 178]/255...)
45+
],
46+
markersize=8
47+
)
48+
scatter!(
49+
ground_truth_data[[2, 4, 6], i], ground_truth_data[[1, 3, 5], i],
50+
color=[
51+
RGB([255, 166, 158]/255...),
52+
RGB([184, 242, 230]/255...),
53+
RGB([174, 217, 224]/255...)
54+
],
55+
markersize=4
56+
)
57+
annotate!(0.1, -0.4, text("i=$i", :left))
58+
end
3159

60+
gif(anim)
61+
end
3262

3363
# ╔═╡ Cell order:
3464
# ╟─194baef2-0417-11ec-05ab-4527ef614024
3565
# ╠═38c9ced5-dcf8-4e03-ac07-7c435687861b
3666
# ╠═5268feee-bda2-4612-9d4c-a1db424a11c7
37-
# ╠═9c8b3f8a-1b85-4c32-a416-ead51b244b94
38-
# ╠═4a1ebdfe-2524-4d3e-b4ab-520af315063f
67+
# ╠═4d0b08a4-8a54-41fd-997f-ad54d4c984cd
68+
# ╠═794374ce-6674-481d-8a3b-04db0f32d233
69+
# ╟─9c8b3f8a-1b85-4c32-a416-ead51b244b94

0 commit comments

Comments
 (0)