forked from ConvLab/ConvLab
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
418 changed files
with
70,645 additions
and
6,382 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+5.66 KB
docs/build/doctrees/convlab.modules.e2e.multiwoz.Mem2Seq.models.doctree
Binary file not shown.
Binary file added
BIN
+14.2 KB
docs/build/doctrees/convlab.modules.e2e.multiwoz.Mem2Seq.utils.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+14.5 KB
docs/build/doctrees/convlab.modules.nlg.multiwoz.multiwoz_template_nlg.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+72.7 KB
docs/build/doctrees/convlab.modules.policy.system.multiwoz.vanilla_mle.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+38.9 KB
docs/build/doctrees/convlab.modules.word_policy.multiwoz.mdrg.doctree
Binary file not shown.
Binary file added
BIN
+85.7 KB
docs/build/doctrees/convlab.modules.word_policy.multiwoz.mdrg.model.doctree
Binary file not shown.
Binary file added
BIN
+43.6 KB
docs/build/doctrees/convlab.modules.word_policy.multiwoz.mdrg.utils.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 9f94c3cb63bd71b6e2e5402fa59e1636 | ||
config: 8d4781a376070f84a925d5268ce15f35 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
499 changes: 499 additions & 0 deletions
499
docs/build/html/_modules/convlab/agent/algorithm/actor_critic.html
Large diffs are not rendered by default.
Oops, something went wrong.
366 changes: 366 additions & 0 deletions
366
docs/build/html/_modules/convlab/agent/algorithm/base.html
Large diffs are not rendered by default.
Oops, something went wrong.
547 changes: 547 additions & 0 deletions
547
docs/build/html/_modules/convlab/agent/algorithm/dqn.html
Large diffs are not rendered by default.
Oops, something went wrong.
261 changes: 261 additions & 0 deletions
261
docs/build/html/_modules/convlab/agent/algorithm/external.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,261 @@ | ||
|
||
|
||
<!DOCTYPE html> | ||
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> | ||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> | ||
<head> | ||
<meta charset="utf-8"> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<title>convlab.agent.algorithm.external — ConvLab 0.1 documentation</title> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<script type="text/javascript" src="../../../../_static/js/modernizr.min.js"></script> | ||
|
||
|
||
<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="../../../../_static/language_data.js"></script> | ||
|
||
<script type="text/javascript" src="../../../../_static/js/theme.js"></script> | ||
|
||
|
||
|
||
|
||
<link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" /> | ||
<link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" /> | ||
<link rel="index" title="Index" href="../../../../genindex.html" /> | ||
<link rel="search" title="Search" href="../../../../search.html" /> | ||
</head> | ||
|
||
<body class="wy-body-for-nav"> | ||
|
||
|
||
<div class="wy-grid-for-nav"> | ||
|
||
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> | ||
<div class="wy-side-scroll"> | ||
<div class="wy-side-nav-search" > | ||
|
||
|
||
|
||
<a href="../../../../index.html" class="icon icon-home"> ConvLab | ||
|
||
|
||
|
||
</a> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div role="search"> | ||
<form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get"> | ||
<input type="text" name="q" placeholder="Search docs" /> | ||
<input type="hidden" name="check_keywords" value="yes" /> | ||
<input type="hidden" name="area" value="default" /> | ||
</form> | ||
</div> | ||
|
||
|
||
</div> | ||
|
||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> | ||
|
||
|
||
|
||
|
||
|
||
|
||
<!-- Local TOC --> | ||
<div class="local-toc"></div> | ||
|
||
|
||
</div> | ||
</div> | ||
</nav> | ||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> | ||
|
||
|
||
<nav class="wy-nav-top" aria-label="top navigation"> | ||
|
||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> | ||
<a href="../../../../index.html">ConvLab</a> | ||
|
||
</nav> | ||
|
||
|
||
<div class="wy-nav-content"> | ||
|
||
<div class="rst-content"> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div role="navigation" aria-label="breadcrumbs navigation"> | ||
|
||
<ul class="wy-breadcrumbs"> | ||
|
||
<li><a href="../../../../index.html">Docs</a> »</li> | ||
|
||
<li><a href="../../../index.html">Module code</a> »</li> | ||
|
||
<li><a href="../../agent.html">convlab.agent</a> »</li> | ||
|
||
<li>convlab.agent.algorithm.external</li> | ||
|
||
|
||
<li class="wy-breadcrumbs-aside"> | ||
|
||
</li> | ||
|
||
</ul> | ||
|
||
|
||
<hr/> | ||
</div> | ||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> | ||
<div itemprop="articleBody"> | ||
|
||
<h1>Source code for convlab.agent.algorithm.external</h1><div class="highlight"><pre> | ||
<span></span><span class="c1"># Modified by Microsoft Corporation.</span> | ||
<span class="c1"># Licensed under the MIT license.</span> | ||
|
||
<span class="sd">'''</span> | ||
<span class="sd">The random agent algorithm</span> | ||
<span class="sd">For basic dev purpose.</span> | ||
<span class="sd">'''</span> | ||
<span class="kn">from</span> <span class="nn">copy</span> <span class="k">import</span> <span class="n">deepcopy</span> | ||
|
||
<span class="kn">import</span> <span class="nn">pydash</span> <span class="k">as</span> <span class="nn">ps</span> | ||
|
||
<span class="kn">from</span> <span class="nn">convlab.agent.algorithm</span> <span class="k">import</span> <span class="n">policy_util</span> | ||
<span class="kn">from</span> <span class="nn">convlab.agent.algorithm.base</span> <span class="k">import</span> <span class="n">Algorithm</span> | ||
<span class="kn">from</span> <span class="nn">convlab.lib</span> <span class="k">import</span> <span class="n">logger</span><span class="p">,</span> <span class="n">util</span> | ||
<span class="kn">from</span> <span class="nn">convlab.lib.decorator</span> <span class="k">import</span> <span class="n">lab_api</span> | ||
<span class="kn">from</span> <span class="nn">convlab.modules</span> <span class="k">import</span> <span class="n">policy</span><span class="p">,</span> <span class="n">word_policy</span><span class="p">,</span> <span class="n">e2e</span> | ||
|
||
<span class="n">logger</span> <span class="o">=</span> <span class="n">logger</span><span class="o">.</span><span class="n">get_logger</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span> | ||
|
||
|
||
<div class="viewcode-block" id="ExternalPolicy"><a class="viewcode-back" href="../../../../convlab.agent.algorithm.html#convlab.agent.algorithm.external.ExternalPolicy">[docs]</a><span class="k">class</span> <span class="nc">ExternalPolicy</span><span class="p">(</span><span class="n">Algorithm</span><span class="p">):</span> | ||
<span class="sd">'''</span> | ||
<span class="sd"> Example Random agent that works in both discrete and continuous envs</span> | ||
<span class="sd"> '''</span> | ||
|
||
<div class="viewcode-block" id="ExternalPolicy.init_algorithm_params"><a class="viewcode-back" href="../../../../convlab.agent.algorithm.html#convlab.agent.algorithm.external.ExternalPolicy.init_algorithm_params">[docs]</a> <span class="nd">@lab_api</span> | ||
<span class="k">def</span> <span class="nf">init_algorithm_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> | ||
<span class="sd">'''Initialize other algorithm parameters'''</span> | ||
<span class="c1"># set default</span> | ||
<span class="n">util</span><span class="o">.</span><span class="n">set_attr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">dict</span><span class="p">(</span> | ||
<span class="n">action_pdtype</span><span class="o">=</span><span class="s1">'default'</span><span class="p">,</span> | ||
<span class="n">action_policy</span><span class="o">=</span><span class="s1">'default'</span><span class="p">,</span> | ||
<span class="p">))</span> | ||
<span class="n">util</span><span class="o">.</span><span class="n">set_attr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">algorithm_spec</span><span class="p">,</span> <span class="p">[</span> | ||
<span class="s1">'policy_name'</span><span class="p">,</span> | ||
<span class="s1">'action_pdtype'</span><span class="p">,</span> | ||
<span class="s1">'action_policy'</span><span class="p">,</span> | ||
<span class="p">])</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">action_policy</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">policy_util</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">action_policy</span><span class="p">)</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">policy</span> <span class="o">=</span> <span class="kc">None</span> | ||
<span class="k">if</span> <span class="s1">'word_policy'</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">algorithm_spec</span><span class="p">:</span> | ||
<span class="n">params</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="n">ps</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">algorithm_spec</span><span class="p">,</span> <span class="s1">'word_policy'</span><span class="p">))</span> | ||
<span class="n">PolicyClass</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">word_policy</span><span class="p">,</span> <span class="n">params</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">'name'</span><span class="p">))</span> | ||
<span class="k">elif</span> <span class="s1">'e2e'</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">algorithm_spec</span><span class="p">:</span> | ||
<span class="n">params</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="n">ps</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">algorithm_spec</span><span class="p">,</span> <span class="s1">'e2e'</span><span class="p">))</span> | ||
<span class="n">PolicyClass</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">e2e</span><span class="p">,</span> <span class="n">params</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">'name'</span><span class="p">))</span> | ||
<span class="k">else</span><span class="p">:</span> | ||
<span class="n">params</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="n">ps</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">algorithm_spec</span><span class="p">,</span> <span class="s1">'policy'</span><span class="p">))</span> | ||
<span class="n">PolicyClass</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">policy</span><span class="p">,</span> <span class="n">params</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">'name'</span><span class="p">))</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">policy</span> <span class="o">=</span> <span class="n">PolicyClass</span><span class="p">(</span><span class="o">**</span><span class="n">params</span><span class="p">)</span> </div> | ||
|
||
<div class="viewcode-block" id="ExternalPolicy.reset"><a class="viewcode-back" href="../../../../convlab.agent.algorithm.html#convlab.agent.algorithm.external.ExternalPolicy.reset">[docs]</a> <span class="k">def</span> <span class="nf">reset</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">policy</span><span class="o">.</span><span class="n">init_session</span><span class="p">()</span></div> | ||
|
||
<div class="viewcode-block" id="ExternalPolicy.init_nets"><a class="viewcode-back" href="../../../../convlab.agent.algorithm.html#convlab.agent.algorithm.external.ExternalPolicy.init_nets">[docs]</a> <span class="nd">@lab_api</span> | ||
<span class="k">def</span> <span class="nf">init_nets</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">global_nets</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> | ||
<span class="k">pass</span></div> | ||
|
||
<div class="viewcode-block" id="ExternalPolicy.act"><a class="viewcode-back" href="../../../../convlab.agent.algorithm.html#convlab.agent.algorithm.external.ExternalPolicy.act">[docs]</a> <span class="nd">@lab_api</span> | ||
<span class="k">def</span> <span class="nf">act</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">):</span> | ||
<span class="n">action</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">policy</span><span class="o">.</span><span class="n">predict</span><span class="p">(</span><span class="n">state</span><span class="p">)</span> | ||
<span class="k">return</span> <span class="n">action</span></div> | ||
|
||
<div class="viewcode-block" id="ExternalPolicy.sample"><a class="viewcode-back" href="../../../../convlab.agent.algorithm.html#convlab.agent.algorithm.external.ExternalPolicy.sample">[docs]</a> <span class="nd">@lab_api</span> | ||
<span class="k">def</span> <span class="nf">sample</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> | ||
<span class="k">pass</span></div> | ||
|
||
<div class="viewcode-block" id="ExternalPolicy.train"><a class="viewcode-back" href="../../../../convlab.agent.algorithm.html#convlab.agent.algorithm.external.ExternalPolicy.train">[docs]</a> <span class="nd">@lab_api</span> | ||
<span class="k">def</span> <span class="nf">train</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> | ||
<span class="k">pass</span></div> | ||
|
||
<div class="viewcode-block" id="ExternalPolicy.update"><a class="viewcode-back" href="../../../../convlab.agent.algorithm.html#convlab.agent.algorithm.external.ExternalPolicy.update">[docs]</a> <span class="nd">@lab_api</span> | ||
<span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> | ||
<span class="k">pass</span></div></div> | ||
</pre></div> | ||
|
||
</div> | ||
|
||
</div> | ||
<footer> | ||
|
||
|
||
<hr/> | ||
|
||
<div role="contentinfo"> | ||
<p> | ||
© Copyright 2019, ConvLab | ||
|
||
</p> | ||
</div> | ||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. | ||
|
||
</footer> | ||
|
||
</div> | ||
</div> | ||
|
||
</section> | ||
|
||
</div> | ||
|
||
|
||
|
||
<script type="text/javascript"> | ||
jQuery(function () { | ||
SphinxRtdTheme.Navigation.enable(true); | ||
}); | ||
</script> | ||
|
||
|
||
|
||
|
||
|
||
|
||
</body> | ||
</html> |
Oops, something went wrong.