PageSourceSearch

https://tianshou.org/en/stable/_static/js/benchmark.js?v=91cdad36

js tianshou.org collected 2026-09-29 07:28:27 UTC 3,089 bytes, 89 lines download raw bytes

1var mujoco_envs = [
2    "Ant-v4",
3];
4
5var atari_envs = [
6    // "PongNoFrameskip-v4",
7    // "BreakoutNoFrameskip-v4",
8    // "EnduroNoFrameskip-v4",
9    // "QbertNoFrameskip-v4",
10    // "MsPacmanNoFrameskip-v4",
11    // "SeaquestNoFrameskip-v4",
12    // "SpaceInvadersNoFrameskip-v4",
13];
14
15function getDataSource(selectEnv, dirName) {
16    return {
17        // Paths are relative to the only file using this script, which is docs/04_benchmarks/benchmarks.rst
18        $schema: "https://vega.github.io/schema/vega-lite/v5.json",
19        data: {
20            url: "../_static/js/" + dirName + "/benchmark/" + selectEnv + "/results.json"
21        },
22        mark: "line",
23        height: 400,
24        width: 800,
25        params: [{name: "Range", value: 1000000, bind: {input: "range", min: 10000, max: 10000000}}],
26        transform: [
27            {calculate: "datum.iqm_confidence_interval[0]", as: "iqm_confidence_lower"},
28            {calculate: "datum.iqm_confidence_interval[1]", as: "iqm_confidence_upper"},
29            {calculate: "datum.iqm", as: "tooltip_str"},
30            {filter: "datum.env_step <= Range"},
31        ],
32        encoding: {
33            color: {"field": "agent", "type": "nominal"},
34            x: {field: "env_step", type: "quantitative", title: "Env step"},
35        },
36        layer: [{
37            "encoding": {
38                "opacity": {"value": 0.3},
39                "y": {
40                    "field": "iqm_confidence_lower",
41                    "type": "quantitative",
42                },
43                "y2": {"field": "iqm_confidence_upper"},
44                tooltip: [
45                    {field: "env_step", type: "quantitative", title: "Env step"},
46                    {field: "agent", type: "nominal"},
47                    {field: "tooltip_str", type: "nominal", title: "Return"},
48                ]
49            },
50            "mark": "area"
51        }, {
52            "encoding": {
53                "y": {
54                    "title": "Return Interquartile Mean (5 seeds)",
55                    "field": "iqm",
56                    "type": "quantitative"
57                }
58            },
59            "mark": "line"
60        }]
61    };
62}
63
64function showMujocoResults(elem) {
65    const selectEnv = elem.value || mujoco_envs[0];
66    const dataSource = getDataSource(selectEnv, "mujoco");
67    vegaEmbed("#vis-mujoco", dataSource);
68}
69
70function showAtariResults(elem) {
71    const selectEnv = elem.value || atari_envs[0];
72    const dataSource = getDataSource(selectEnv, "atari");
73    vegaEmbed("#vis-atari", dataSource);
74}
75
76
77
78document.addEventListener('DOMContentLoaded', function()  {
79    var envMujocoSelect = $("#env-mujoco");
80    if (envMujocoSelect.length) {
81        $.each(mujoco_envs, function(idx, env) {envMujocoSelect.append($("<option></option>").val(env).html(env));})
82        showMujocoResults(envMujocoSelect);
83    }
84    var envAtariSelect = $("#env-atari");
85    if (envAtariSelect.length) {
86        $.each(atari_envs, function(idx, env) {envAtariSelect.append($("<option></option>").val(env).html(env));})
87        showAtariResults(envAtariSelect);
88    }
89});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.