options.html 11.6 KB
Newer Older
Aravind Bk's avatar
Aravind Bk committed
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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>options package &#8212; WiseMove  documentation</title>
    <link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/fonts.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" /> 
  </head><body>
      <div class="header" role="banner"><h1 class="heading"><a href="../index.html">
          <span>WiseMove  documentation</span></a></h1>
        <h2 class="heading"><span>options package</span></h2>
      </div>
      <div class="topnav" role="navigation" aria-label="top navigation">
      
        <p>
        <a class="uplink" href="../index.html">Contents</a>
        </p>

      </div>
      <div class="content">
        
        
  <div class="section" id="options-package">
<h1>options package<a class="headerlink" href="#options-package" title="Permalink to this headline"></a></h1>
<div class="section" id="subpackages">
<h2>Subpackages<a class="headerlink" href="#subpackages" title="Permalink to this headline"></a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="options.simple_intersection.html">options.simple_intersection package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="options.simple_intersection.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="options.simple_intersection.html#module-options.simple_intersection.maneuver_base">options.simple_intersection.maneuver_base module</a></li>
<li class="toctree-l2"><a class="reference internal" href="options.simple_intersection.html#module-options.simple_intersection.maneuvers">options.simple_intersection.maneuvers module</a></li>
<li class="toctree-l2"><a class="reference internal" href="options.simple_intersection.html#module-options.simple_intersection">Module contents</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="module-options.options_loader">
<span id="options-options-loader-module"></span><h2>options.options_loader module<a class="headerlink" href="#module-options.options_loader" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="options.options_loader.OptionsGraph">
<em class="property">class </em><code class="descclassname">options.options_loader.</code><code class="descname">OptionsGraph</code><span class="sig-paren">(</span><em>json_path</em>, <em>env_class</em>, <em>*env_args</em>, <em>**env_kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#options.options_loader.OptionsGraph" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Represent the options graph as a graph like structure. The configuration
is specified in a json file and consists of the following specific values:</p>
<ul class="simple">
<li>nodes: dictionary of policy node aliases -&gt; maneuver classes</li>
<li><dl class="first docutils">
<dt>edges: dictionary such that it has key value pairs which represent</dt>
<dd>edges between policy node aliases</dd>
</dl>
</li>
<li>starting_node: ego’s starting node</li>
</ul>
<dl class="attribute">
<dt id="options.options_loader.OptionsGraph.adj">
<code class="descname">adj</code><em class="property"> = None</em><a class="headerlink" href="#options.options_loader.OptionsGraph.adj" title="Permalink to this definition"></a></dt>
<dd><p>adjacency list from the graph</p>
</dd></dl>

<dl class="attribute">
<dt id="options.options_loader.OptionsGraph.current_node">
<code class="descname">current_node</code><a class="headerlink" href="#options.options_loader.OptionsGraph.current_node" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="options.options_loader.OptionsGraph.edges">
<code class="descname">edges</code><em class="property"> = None</em><a class="headerlink" href="#options.options_loader.OptionsGraph.edges" title="Permalink to this definition"></a></dt>
<dd><p>edges of the graph</p>
</dd></dl>

<dl class="method">
<dt id="options.options_loader.OptionsGraph.execute_controller_policy">
<code class="descname">execute_controller_policy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#options.options_loader.OptionsGraph.execute_controller_policy" title="Permalink to this definition"></a></dt>
91 92 93 94
<dd><p>Performs low level steps and transitions to other nodes using
controller transition policy.</p>
<p>Returns state after one step, step reward,
episode_termination_flag, info</p>
Aravind Bk's avatar
Aravind Bk committed
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
</dd></dl>

<dl class="method">
<dt id="options.options_loader.OptionsGraph.get_number_of_nodes">
<code class="descname">get_number_of_nodes</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#options.options_loader.OptionsGraph.get_number_of_nodes" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="options.options_loader.OptionsGraph.load_trained_low_level_policies">
<code class="descname">load_trained_low_level_policies</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#options.options_loader.OptionsGraph.load_trained_low_level_policies" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="options.options_loader.OptionsGraph.nodes">
<code class="descname">nodes</code><em class="property"> = None</em><a class="headerlink" href="#options.options_loader.OptionsGraph.nodes" title="Permalink to this definition"></a></dt>
<dd><p>nodes of the graph</p>
</dd></dl>

<dl class="method">
<dt id="options.options_loader.OptionsGraph.render">
<code class="descname">render</code><span class="sig-paren">(</span><em>mode='human'</em><span class="sig-paren">)</span><a class="headerlink" href="#options.options_loader.OptionsGraph.render" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="options.options_loader.OptionsGraph.reset">
<code class="descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#options.options_loader.OptionsGraph.reset" title="Permalink to this definition"></a></dt>
<dd><p>Reset the environment. This function may be needed to reset the
environment for eg. after an MCTS rollout and update. Also reset the
controller to root node.</p>
<p>Returns whatever the environment’s reset returns.</p>
</dd></dl>

<dl class="method">
<dt id="options.options_loader.OptionsGraph.set_controller_args">
<code class="descname">set_controller_args</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#options.options_loader.OptionsGraph.set_controller_args" title="Permalink to this definition"></a></dt>
130
<dd><p>Sets custom arguments depending on the chosen controller.</p>
Aravind Bk's avatar
Aravind Bk committed
131 132 133 134 135 136 137 138 139 140 141 142 143
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>**kwargs</strong> – dictionary of args and values</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="options.options_loader.OptionsGraph.set_controller_policy">
<code class="descname">set_controller_policy</code><span class="sig-paren">(</span><em>policy</em><span class="sig-paren">)</span><a class="headerlink" href="#options.options_loader.OptionsGraph.set_controller_policy" title="Permalink to this definition"></a></dt>
144 145 146
<dd><p>Sets the trained controller policy as a function which takes in
feature vector and returns an option index(int). By default,
trained_policy is None.</p>
Aravind Bk's avatar
Aravind Bk committed
147 148 149 150 151 152 153 154 155 156 157 158 159
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>policy</strong> – a function which takes in feature vector and returns an option index(int)</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="options.options_loader.OptionsGraph.set_current_node">
<code class="descname">set_current_node</code><span class="sig-paren">(</span><em>node_alias</em><span class="sig-paren">)</span><a class="headerlink" href="#options.options_loader.OptionsGraph.set_current_node" title="Permalink to this definition"></a></dt>
160 161
<dd><p>Sets the current node for controller. Used for training/testing a
particular node.</p>
Aravind Bk's avatar
Aravind Bk committed
162 163 164 165 166 167 168 169 170 171 172 173 174
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>node_alias</strong> – alias of the node as per config file</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="options.options_loader.OptionsGraph.step">
<code class="descname">step</code><span class="sig-paren">(</span><em>option</em><span class="sig-paren">)</span><a class="headerlink" href="#options.options_loader.OptionsGraph.step" title="Permalink to this definition"></a></dt>
175 176 177
<dd><p>Complete an episode using specified option. This assumes that the
manager’s env is at a place where the option’s initiation condition is
met.</p>
Aravind Bk's avatar
Aravind Bk committed
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>option</strong> – index of high level option to be executed</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="options.options_loader.OptionsGraph.visualize_low_level_steps">
<code class="descname">visualize_low_level_steps</code><em class="property"> = False</em><a class="headerlink" href="#options.options_loader.OptionsGraph.visualize_low_level_steps" title="Permalink to this definition"></a></dt>
<dd><p>visualization flag</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-options">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-options" title="Permalink to this headline"></a></h2>
</div>
</div>


      </div>
      <div class="bottomnav" role="navigation" aria-label="bottom navigation">
      
        <p>
        <a class="uplink" href="../index.html">Contents</a>
        </p>

      </div>

    <div class="footer" role="contentinfo">
        &#169; Copyright 2018, Sean Sedwards, Jaeyoung Lee, Ashish Gaurav, Aravind Balakrishnan.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.8.
    </div>
  </body>
</html>