Skip to content

Commit

Permalink
Deploying to gh-pages from @ e482bf5 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
younik committed Jan 6, 2025
1 parent 70861b2 commit bbda487
Show file tree
Hide file tree
Showing 348 changed files with 1,478 additions and 1,476 deletions.
2 changes: 1 addition & 1 deletion main/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 229747253a9e489cf3bfaacf595308c4
config: 11e0cc96f0f7050cd7ccb6a72cf5ba69
tags: d77d1c0d9ca2f4c8421862c7c5a0d620
2 changes: 1 addition & 1 deletion main/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<link rel="shortcut icon" href="/_static/favicon.png"/><!-- Generated with Sphinx 7.4.7 and Furo 2023.08.19.dev1 -->
<title>404 - Page Not Found - Minari Documentation</title>
<link rel="stylesheet" type="text/css" href="/_static/pygments.css?v=a746c00c" />
<link rel="stylesheet" type="text/css" href="/_static/pygments.css?v=8f2a1f02" />
<link rel="stylesheet" type="text/css" href="/_static/styles/furo.css?v=3e7f4c72" />
<link rel="stylesheet" type="text/css" href="/_static/sg_gallery.css?v=61a4c737" />
<link rel="stylesheet" type="text/css" href="/_static/sg_gallery-binder.css?v=ca3c1c84" />
Expand Down
2 changes: 1 addition & 1 deletion main/README/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<link rel="shortcut icon" href="../_static/favicon.png"/><!-- Generated with Sphinx 7.4.7 and Furo 2023.08.19.dev1 -->
<title>Minari documentation - Minari Documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=a746c00c" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=8f2a1f02" />
<link rel="stylesheet" type="text/css" href="../_static/styles/furo.css?v=3e7f4c72" />
<link rel="stylesheet" type="text/css" href="../_static/sg_gallery.css?v=61a4c737" />
<link rel="stylesheet" type="text/css" href="../_static/sg_gallery-binder.css?v=ca3c1c84" />
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# Lets start by importing the required modules for this tutorial:

import gymnasium as gym
import gymnasium_robotics # noqa: F401
import numpy as np

from minari import DataCollector, StepDataCallback
Expand Down Expand Up @@ -383,7 +384,7 @@ def __call__(

obs, _ = collector_env.reset(seed=123)

waypoint_controller = WaypointController(maze=env.maze)
waypoint_controller = WaypointController(maze=env.unwrapped.maze)

for n_step in range(int(total_steps)):
action = waypoint_controller.compute_action(obs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"outputs": [],
"source": [
"import gymnasium as gym\nimport numpy as np\n\nfrom minari import DataCollector, StepDataCallback"
"import gymnasium as gym\nimport gymnasium_robotics # noqa: F401\nimport numpy as np\n\nfrom minari import DataCollector, StepDataCallback"
]
},
{
Expand Down Expand Up @@ -105,7 +105,7 @@
},
"outputs": [],
"source": [
"dataset_name = \"pointmaze/umaze-v0\"\ntotal_steps = 10_000\n\n# continuing task => the episode doesn't terminate or truncate when reaching a goal\n# it will generate a new target. For this reason we set the maximum episode steps to\n# the desired size of our Minari dataset (evade truncation due to time limit)\nenv = gym.make(\"PointMaze_Medium-v3\", continuing_task=True, max_episode_steps=total_steps)\n\n# Data collector wrapper to save temporary data while stepping. Characteristics:\n# * Custom StepDataCallback to add extra state information to 'infos' and divide dataset in different episodes by overridng\n# truncation value to True when target is reached\n# * Record the 'info' value of every step\ncollector_env = DataCollector(\n env, step_data_callback=PointMazeStepDataCallback, record_infos=True\n)\n\nobs, _ = collector_env.reset(seed=123)\n\nwaypoint_controller = WaypointController(maze=env.maze)\n\nfor n_step in range(int(total_steps)):\n action = waypoint_controller.compute_action(obs)\n # Add some noise to each step action\n action += np.random.randn(*action.shape) * 0.5\n action = np.clip(\n action, env.action_space.low, env.action_space.high, dtype=np.float32\n )\n\n obs, rew, terminated, truncated, info = collector_env.step(action)\n\ndataset = collector_env.create_dataset(\n dataset_id=dataset_name,\n algorithm_name=\"QIteration\",\n code_permalink=\"https://github.com/Farama-Foundation/Minari/blob/main/docs/tutorials/dataset_creation/point_maze_dataset.py\",\n author=\"Rodrigo Perez-Vicente\",\n author_email=\"rperezvicente@farama.org\",\n)"
"dataset_name = \"pointmaze/umaze-v0\"\ntotal_steps = 10_000\n\n# continuing task => the episode doesn't terminate or truncate when reaching a goal\n# it will generate a new target. For this reason we set the maximum episode steps to\n# the desired size of our Minari dataset (evade truncation due to time limit)\nenv = gym.make(\"PointMaze_Medium-v3\", continuing_task=True, max_episode_steps=total_steps)\n\n# Data collector wrapper to save temporary data while stepping. Characteristics:\n# * Custom StepDataCallback to add extra state information to 'infos' and divide dataset in different episodes by overridng\n# truncation value to True when target is reached\n# * Record the 'info' value of every step\ncollector_env = DataCollector(\n env, step_data_callback=PointMazeStepDataCallback, record_infos=True\n)\n\nobs, _ = collector_env.reset(seed=123)\n\nwaypoint_controller = WaypointController(maze=env.unwrapped.maze)\n\nfor n_step in range(int(total_steps)):\n action = waypoint_controller.compute_action(obs)\n # Add some noise to each step action\n action += np.random.randn(*action.shape) * 0.5\n action = np.clip(\n action, env.action_space.low, env.action_space.high, dtype=np.float32\n )\n\n obs, rew, terminated, truncated, info = collector_env.step(action)\n\ndataset = collector_env.create_dataset(\n dataset_id=dataset_name,\n algorithm_name=\"QIteration\",\n code_permalink=\"https://github.com/Farama-Foundation/Minari/blob/main/docs/tutorials/dataset_creation/point_maze_dataset.py\",\n author=\"Rodrigo Perez-Vicente\",\n author_email=\"rperezvicente@farama.org\",\n)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion main/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<link rel="shortcut icon" href="../_static/favicon.png"/><!-- Generated with Sphinx 7.4.7 and Furo 2023.08.19.dev1 -->
<title>Overview: module code - Minari Documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=a746c00c" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=8f2a1f02" />
<link rel="stylesheet" type="text/css" href="../_static/styles/furo.css?v=3e7f4c72" />
<link rel="stylesheet" type="text/css" href="../_static/sg_gallery.css?v=61a4c737" />
<link rel="stylesheet" type="text/css" href="../_static/sg_gallery-binder.css?v=ca3c1c84" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<link rel="shortcut icon" href="../../../../../_static/favicon.png"/><!-- Generated with Sphinx 7.4.7 and Furo 2023.08.19.dev1 -->
<title>minari.data_collector.callbacks.episode_metadata - Minari Documentation</title>
<link rel="stylesheet" type="text/css" href="../../../../../_static/pygments.css?v=a746c00c" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/pygments.css?v=8f2a1f02" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/styles/furo.css?v=3e7f4c72" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/sg_gallery.css?v=61a4c737" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/sg_gallery-binder.css?v=ca3c1c84" />
Expand Down Expand Up @@ -802,20 +802,20 @@
<article role="main">

<h1>Source code for minari.data_collector.callbacks.episode_metadata</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Dict</span>
<span></span><span class="kn">from</span><span class="w"> </span><span class="nn">typing</span><span class="w"> </span><span class="kn">import</span> <span class="n">Dict</span>


<div class="viewcode-block" id="EpisodeMetadataCallback">
<a class="viewcode-back" href="../../../../../api/data_collector/episode_metadata_callback/#minari.EpisodeMetadataCallback">[docs]</a>
<span class="k">class</span> <span class="nc">EpisodeMetadataCallback</span><span class="p">:</span>
<span class="k">class</span><span class="w"> </span><span class="nc">EpisodeMetadataCallback</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Callback to full episode after saving to hdf5 file as a group.</span>

<span class="sd"> This callback can be overridden to add extra metadata attributes or statistics to</span>
<span class="sd"> each episode in the Minari dataset. The custom callback can then be</span>
<span class="sd"> passed to the DataCollector wrapper to the `episode_metadata_callback` argument.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="k">def</span> <span class="fm">__call__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">episode</span><span class="p">:</span> <span class="n">Dict</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Dict</span><span class="p">:</span>
<span class="k">def</span><span class="w"> </span><span class="fm">__call__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">episode</span><span class="p">:</span> <span class="n">Dict</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Dict</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Callback method.</span>

<span class="sd"> Override this method to add custom attribute metadata to the episode group.</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<link rel="shortcut icon" href="../../../../../_static/favicon.png"/><!-- Generated with Sphinx 7.4.7 and Furo 2023.08.19.dev1 -->
<title>minari.data_collector.callbacks.step_callback - Minari Documentation</title>
<link rel="stylesheet" type="text/css" href="../../../../../_static/pygments.css?v=a746c00c" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/pygments.css?v=8f2a1f02" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/styles/furo.css?v=3e7f4c72" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/sg_gallery.css?v=61a4c737" />
<link rel="stylesheet" type="text/css" href="../../../../../_static/sg_gallery-binder.css?v=ca3c1c84" />
Expand Down Expand Up @@ -802,23 +802,23 @@
<article role="main">

<h1>Source code for minari.data_collector.callbacks.step_callback</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">Optional</span>
<span></span><span class="kn">from</span><span class="w"> </span><span class="nn">typing</span><span class="w"> </span><span class="kn">import</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">Optional</span>

<span class="kn">import</span> <span class="nn">gymnasium</span> <span class="k">as</span> <span class="nn">gym</span>
<span class="kn">import</span><span class="w"> </span><span class="nn">gymnasium</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="nn">gym</span>

<span class="kn">from</span> <span class="nn">minari.dataset.step_data</span> <span class="kn">import</span> <span class="n">StepData</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">minari.dataset.step_data</span><span class="w"> </span><span class="kn">import</span> <span class="n">StepData</span>


<div class="viewcode-block" id="StepDataCallback">
<a class="viewcode-back" href="../../../../../api/data_collector/step_data_callback/#minari.StepDataCallback">[docs]</a>
<span class="k">class</span> <span class="nc">StepDataCallback</span><span class="p">:</span>
<span class="k">class</span><span class="w"> </span><span class="nc">StepDataCallback</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Callback to create step data dictionary from the return data of each Gymnasium environment step.</span>

<span class="sd"> This callback can be overridden to add extra environment information in each step or</span>
<span class="sd"> edit the observation, action, reward, termination, truncation, or info returns.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="k">def</span> <span class="fm">__call__</span><span class="p">(</span>
<span class="k">def</span><span class="w"> </span><span class="fm">__call__</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">env</span><span class="p">:</span> <span class="n">gym</span><span class="o">.</span><span class="n">Env</span><span class="p">,</span>
<span class="n">obs</span><span class="p">:</span> <span class="n">Any</span><span class="p">,</span>
Expand Down
Loading

0 comments on commit bbda487

Please sign in to comment.