mirror of
https://gitlab.rlp.net/mobitar/ReCo.jl.git
synced 2024-11-08 22:21:08 +00:00
mean_kappa documentation
This commit is contained in:
parent
539029c3a1
commit
54f8a1bfaf
3 changed files with 20 additions and 7 deletions
|
@ -130,7 +130,7 @@ include("src/RL/latex_table.jl")
|
||||||
latex_rl_table(env_helper, FILENAME_WITHOUT_EXTENSION)
|
latex_rl_table(env_helper, FILENAME_WITHOUT_EXTENSION)
|
||||||
----
|
----
|
||||||
|
|
||||||
`FILENAME_WITHOUT_EXTENSION` has to be replaced by the wanted file name without extension of the `.tex` file. The documentation of `latex_rl_table` explains where the output is placed.
|
`FILENAME_WITHOUT_EXTENSION` has to be replaced by the wanted file name without extension of the `.tex` file. The method's documentation explains where the output is placed.
|
||||||
|
|
||||||
The output file can be used in a LaTeX document:
|
The output file can be used in a LaTeX document:
|
||||||
|
|
||||||
|
@ -164,16 +164,16 @@ To plot the mean of kappa as the ratio of the eigenvalues of the gyration tensor
|
||||||
[source,julia]
|
[source,julia]
|
||||||
----
|
----
|
||||||
include("analysis/mean_kappa.jl")
|
include("analysis/mean_kappa.jl")
|
||||||
plot_mean_kappa(; rl_dir=rl_dir, n_last_episodes=N_LAST_EPISODES)
|
plot_mean_κ(; rl_dir=rl_dir, n_last_episodes=N_LAST_EPISODES)
|
||||||
----
|
----
|
||||||
|
|
||||||
`N_LAST_EPISODES` is the number of the last episodes of the learning process to average over.
|
`N_LAST_EPISODES` is the number of the last episodes of the learning process to average over. The method's documentation explains where the output is placed.
|
||||||
|
|
||||||
== Run analysis
|
== Run analysis
|
||||||
|
|
||||||
After running the following command blocks in the REPL, the output can be found in the directory `ReCo.jl/exports/graphics`.
|
After running the following command blocks in the REPL, the output can be found in the directory `ReCo.jl/exports/graphics`.
|
||||||
|
|
||||||
=== Mean squared displacement
|
=== Mean squared displacement and random walk
|
||||||
|
|
||||||
[source,julia]
|
[source,julia]
|
||||||
----
|
----
|
||||||
|
|
|
@ -6,7 +6,18 @@ using ReCo: ReCo
|
||||||
|
|
||||||
include("../src/Visualization/common_CairoMakie.jl")
|
include("../src/Visualization/common_CairoMakie.jl")
|
||||||
|
|
||||||
function plot_mean_kappa(; rl_dir::String, n_last_episodes::Int64)
|
"""
|
||||||
|
plot_mean_κ(; rl_dir::String, n_last_episodes::Int64)
|
||||||
|
|
||||||
|
Plot the mean of `κ` of the learning process at the directory `rl_dir`.
|
||||||
|
|
||||||
|
`κ` is the ratio of the eigenvalues of the gyration tensor. `n_last_episodes` is the number of the last episodes of the learning process to average over.
|
||||||
|
|
||||||
|
The output is `rl_dir/mean_kappa.pdf`.
|
||||||
|
|
||||||
|
Return `nothing`.
|
||||||
|
"""
|
||||||
|
function plot_mean_κ(; rl_dir::String, n_last_episodes::Int64)
|
||||||
dir_content = readdir(rl_dir; join=true, sort=true)
|
dir_content = readdir(rl_dir; join=true, sort=true)
|
||||||
n_content = length(dir_content)
|
n_content = length(dir_content)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
using DataFrames: DataFrames
|
using DataFrames: DataFrames
|
||||||
using PrettyTables: pretty_table
|
using PrettyTables: pretty_table
|
||||||
|
|
||||||
|
using ReCo: ReCo
|
||||||
|
|
||||||
function latex_table(
|
function latex_table(
|
||||||
dataframe::DataFrames.DataFrame, filename::String; path::String="exports/$filename"
|
dataframe::DataFrames.DataFrame, filename::String; path::String="exports/$filename"
|
||||||
)
|
)
|
||||||
|
@ -12,7 +14,7 @@ function latex_table(
|
||||||
end
|
end
|
||||||
|
|
||||||
"""
|
"""
|
||||||
latex_rl_table(env_helper, filename_without_extension::String)
|
latex_rl_table(env_helper::ReCo.RL.EnvHelper, filename_without_extension::String)
|
||||||
|
|
||||||
Generate a LaTeX table to the Q-matrix of `env_helper`.
|
Generate a LaTeX table to the Q-matrix of `env_helper`.
|
||||||
|
|
||||||
|
@ -20,7 +22,7 @@ The output is `ReCo.jl/exports/filename_without_extension.tex`. `env_helper` has
|
||||||
|
|
||||||
Return `nothing`.
|
Return `nothing`.
|
||||||
"""
|
"""
|
||||||
function latex_rl_table(env_helper, filename_without_extension::String)
|
function latex_rl_table(env_helper::ReCo.RL.EnvHelper, filename_without_extension::String)
|
||||||
table = copy(env_helper.shared.agent.policy.learner.approximator.table)
|
table = copy(env_helper.shared.agent.policy.learner.approximator.table)
|
||||||
|
|
||||||
for col in 1:size(table)[2]
|
for col in 1:size(table)[2]
|
||||||
|
|
Loading…
Reference in a new issue