This repository was archived by the owner on Jun 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathplots.R
67 lines (58 loc) · 3.07 KB
/
plots.R
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
library(ggplot2)
df = read.delim("/tmp/f", s=" ", h=F, col.names=c("run", "length", "reward"))
df$n = 1:nrow(df)
head(df)
ggplot(df, aes())
# df = read.delim("/tmp/actions", h=T, sep=" ")
# png("/tmp/plots/00a_pre_noise_x_y_scatter.png", width=300, height=300)
# ggplot(df[df$type=='pre',], aes(x, y)) + geom_bin2d() + labs(title="x pre noise")
# dev.off()
# png("/tmp/plots/00b_post_noise_x_y_scatter.png", width=300, height=300)
# ggplot(df[df$type=='post',], aes(x, y)) + geom_bin2d() + labs(title="x post noise")
# dev.off()
# png("/tmp/plots/00c_x_over_time.png", width=640, height=400)
# ggplot(df, aes(episode, x)) + geom_point(alpha=0.1) + geom_smooth() + facet_grid(type~.) + labs(title="x over time")
# dev.off()
# png("/tmp/plots/00d_y_over_time.png", width=640, height=400)
# ggplot(df, aes(episode, y)) + geom_point(alpha=0.1) + geom_smooth() + facet_grid(type~.) + labs(title="yx over time")
# dev.off()
df = read.delim("/tmp/q_values", h=T, sep=" ")
png("/tmp/plots/05a_action_q_values.png", width=640, height=320)
ggplot(df, aes(episode, q_value)) + geom_point(alpha=0.2, aes(color=net_type)) + geom_smooth(aes(color=net_type)) + labs(title="q values over time")
dev.off()
df = read.delim("/tmp/episode_stats", h=T, sep=" ")
png("/tmp/plots/06a_episode_len.png", width=640, height=320)
ggplot(df, aes(episode, len)) + geom_point(alpha=0.2) + geom_smooth() + labs(title="episode len")
dev.off()
png("/tmp/plots/06b_episode_rewards.png", width=640, height=320)
ggplot(df, aes(episode, total_reward)) + geom_point(alpha=0.2) + geom_smooth() + labs(title="episode total reward")
dev.off()
png("/tmp/plots/06c_episode_stats.png", width=320, height=320)
ggplot(df, aes(len, total_reward)) + geom_point(alpha=0.2) + labs(title="episode step vs reward")
dev.off()
df = read.delim("/tmp/eval", h=T, sep=" ")
png("/tmp/plots/07a_eval_episode_len.png", width=640, height=320)
ggplot(df, aes(episode, steps)) + geom_point(alpha=0.2) + geom_smooth() + labs(title="eval episode len")
dev.off()
png("/tmp/plots/07b_eval_total_reward.png", width=640, height=320)
ggplot(df, aes(episode, total_reward)) + geom_point(alpha=0.2) + geom_smooth() + labs(title="eval total reward")
dev.off()
# df = read.delim("/tmp/batch_num_terminal", h=T, sep=" ")
# png("/tmp/plots/08_batch_num_terminal.png", width=640, height=320)
# ggplot(df, aes(episode, batch_num_terminals)) + geom_point(alpha=0.2) + geom_smooth() + labs(# title="batch num terminal")
# dev.off()
df = read.delim("/tmp/gradient_l2_norms", sep=" ")
png("/tmp/plots/09_gradient_l2_norms.png", width=640, height=320)
ggplot(df, aes(time, l2_norm)) +
geom_point(alpha=0.1, aes(color=source)) +
geom_smooth(aes(color=source))
dev.off()
df = read.delim("/tmp/q_loss", h=T, sep=" ")
png("/tmp/plots/10_q_loss.png", width=640, height=320)
ggplot(df, aes(episode, q_loss)) + geom_point(alpha=0.1) + geom_smooth() + labs(title="critic training q loss")
dev.off()
# df = read.delim("/tmp/replay_memory_size", h=F)
# df$n = 1:nrow(df)
# png("/tmp/plots/09_replay_memory_size.png", width=640, height=320)
# ggplot(df, aes(n, V1)) + geom_point() + labs(title="replay memory size")
# dev.off()