<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns=“www.w3.org/1999/xhtml” xml:lang=“en” lang=“en”>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>

Class: NEAT::BasicNeuronTypes::CosineNeuron

  &mdash; Documentation by YARD 0.8.7.3

</title>

<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />

<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />

<script type=“text/javascript” charset=“utf-8”>

hasFrames = window.top.frames.main ? true : false;
relpath = '../../';
framesUrl = "../../frames.html#!" + escape(window.location.href);

</script>

<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>

<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>

</head>
<body>
  <div id="header">
    <div id="menu">

  <a href="../../_index.html">Index (C)</a> &raquo;
  <span class='title'><span class='object_link'><a href="../../NEAT.html" title="NEAT (module)">NEAT</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../BasicNeuronTypes.html" title="NEAT::BasicNeuronTypes (module)">BasicNeuronTypes</a></span></span>
   &raquo; 
  <span class="title">CosineNeuron</span>

<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>

</div>

  <div id="search">

<a class="full_list_link" id="class_list_link"
    href="../../class_list.html">
  Class List
</a>

<a class="full_list_link" id="method_list_link"
    href="../../method_list.html">
  Method List
</a>

<a class="full_list_link" id="file_list_link"
    href="../../file_list.html">
  File List
</a>

</div>

  <div class="clear"></div>
</div>

<iframe id="search_frame"></iframe>

<div id="content"><h1>Class: NEAT::BasicNeuronTypes::CosineNeuron

</h1>

<dl class=“box”>

<dt class="r1">Inherits:</dt>
<dd class="r1">
  <span class="inheritName"><span class='object_link'><a href="../Neuron.html" title="NEAT::Neuron (class)">Neuron</a></span></span>

    <ul class="fullTree">
      <li>Object</li>

        <li class="next"><span class='object_link'><a href="../NeatOb.html" title="NEAT::NeatOb (class)">NeatOb</a></span></li>

        <li class="next"><span class='object_link'><a href="../Neuron.html" title="NEAT::Neuron (class)">Neuron</a></span></li>

        <li class="next">NEAT::BasicNeuronTypes::CosineNeuron</li>

    </ul>
    <a href="#" class="inheritanceTree">show all</a>

  </dd>

<dt class="r2 last">Defined in:</dt>
<dd class="r2 last">lib/rubyneat/neuron.rb</dd>

</dl> <div class=“clear”></div>

<h2>Overview</h2><div class=“docstring”>

<div class="discussion">

<p>Cosine function (CPPN) – adjusted to have its +1 and -1 near TanhNeuron</p>

</div>

</div> <div class=“tags”>

</div>

<h2>Instance Attribute Summary</h2>

<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../Neuron.html" title="NEAT::Neuron (class)">Neuron</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Neuron.html#genotype-instance_method" title="NEAT::Neuron#genotype (method)">#genotype</a></span>, <span class='object_link'><a href="../Neuron.html#heirarchy_number-instance_method" title="NEAT::Neuron#heirarchy_number (method)">#heirarchy_number</a></span>, <span class='object_link'><a href="../Neuron.html#output-instance_method" title="NEAT::Neuron#output (method)">#output</a></span>, <span class='object_link'><a href="../Neuron.html#trait-instance_method" title="NEAT::Neuron#trait (method)">#trait</a></span></p>

<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../NeatOb.html" title="NEAT::NeatOb (class)">NeatOb</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../NeatOb.html#controller-instance_method" title="NEAT::NeatOb#controller (method)">#controller</a></span>, <span class='object_link'><a href="../NeatOb.html#name-instance_method" title="NEAT::NeatOb#name (method)">#name</a></span></p>

  <h2>
    Instance Method Summary
    <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
  </h2>

  <ul class="summary">

      <li class="public ">
<span class="summary_signature">

    <a href="#express-instance_method" title="#express (instance method)">- (Object) <strong>express</strong>(instance) </a>

</span>

  <span class="summary_desc"><div class='inline'>

<p>create a function on the instance with our name that sums all inputs and produce a sigmoid output (using tanh).</p> </div></span>

</li>

  </ul>

<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../Neuron.html" title="NEAT::Neuron (class)">Neuron</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Neuron.html#bias%3F-instance_method" title="NEAT::Neuron#bias? (method)">#bias?</a></span>, <span class='object_link'><a href="../Neuron.html#bias%3F-class_method" title="NEAT::Neuron.bias? (method)">bias?</a></span>, <span class='object_link'><a href="../Neuron.html#inherited-class_method" title="NEAT::Neuron.inherited (method)">inherited</a></span>, <span class='object_link'><a href="../Neuron.html#input%3F-class_method" title="NEAT::Neuron.input? (method)">input?</a></span>, <span class='object_link'><a href="../Neuron.html#input%3F-instance_method" title="NEAT::Neuron#input? (method)">#input?</a></span>, <span class='object_link'><a href="../Neuron.html#neuron_types-class_method" title="NEAT::Neuron.neuron_types (method)">neuron_types</a></span>, <span class='object_link'><a href="../Neuron.html#output%3F-instance_method" title="NEAT::Neuron#output? (method)">#output?</a></span></p>

<h3 class="inherited">Methods included from <span class='object_link'><a href="../Graph.html" title="NEAT::Graph (module)">Graph</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Graph.html#%3C%3C-instance_method" title="NEAT::Graph#&lt;&lt; (method)">#<<</a></span>, <span class='object_link'><a href="../Graph.html#add-instance_method" title="NEAT::Graph#add (method)">#add</a></span>, <span class='object_link'><a href="../Graph.html#clear_graph-instance_method" title="NEAT::Graph#clear_graph (method)">#clear_graph</a></span>, <span class='object_link'><a href="../Graph.html#inputs-instance_method" title="NEAT::Graph#inputs (method)">#inputs</a></span></p>

<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../NeatOb.html" title="NEAT::NeatOb (class)">NeatOb</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../NeatOb.html#initialize-instance_method" title="NEAT::NeatOb#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="../NeatOb.html#log-instance_method" title="NEAT::NeatOb#log (method)">#log</a></span>, <span class='object_link'><a href="../NeatOb.html#log-class_method" title="NEAT::NeatOb.log (method)">log</a></span>, <span class='object_link'><a href="../NeatOb.html#to_s-instance_method" title="NEAT::NeatOb#to_s (method)">#to_s</a></span></p>

<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>

  <p class="notice">This class inherits a constructor from <span class='object_link'><a href="../NeatOb.html#initialize-instance_method" title="NEAT::NeatOb#initialize (method)">NEAT::NeatOb</a></span></p>

</div>

<div id="instance_method_details" class="method_details_list">
  <h2>Instance Method Details</h2>

    <div class="method_details first">
<h3 class="signature first" id="express-instance_method">

  - (<tt>Object</tt>) <strong>express</strong>(instance)

</h3><div class=“docstring”>

<div class="discussion">

<p>create a function on the instance with our name that sums all inputs and produce a sigmoid output (using tanh)</p>

</div>

</div> <div class=“tags”>

</div><table class=“source_code”>

<tr>
  <td>
    <pre class="lines">

144 145 146 147 148</pre>

</td>
<td>
  <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 144</span>

<span class='kw'>def</span> <span class='id identifier rubyid_express'>express</span><span class='lparen'>(</span><span class='id identifier rubyid_instance'>instance</span><span class='rparen'>)</span>

<span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_define_singleton_method'>define_singleton_method</span><span class='lparen'>(</span><span class='ivar'>@name</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='op'>*</span><span class='id identifier rubyid_inputs'>inputs</span><span class='op'>|</span>
  <span class='id identifier rubyid_cos'>cos</span><span class='lparen'>(</span><span class='float'>1.6</span> <span class='op'>*</span> <span class='id identifier rubyid_inputs'>inputs</span><span class='period'>.</span><span class='id identifier rubyid_reduce'>reduce</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='comma'>,</span> <span class='id identifier rubyid_q'>q</span><span class='op'>|</span> <span class='id identifier rubyid_p'>p</span> <span class='op'>+</span> <span class='id identifier rubyid_q'>q</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='rbrace'>}</span>

<span class='kw'>end</span></pre>

  </td>
</tr>

</table> </div>

</div>

</div>

  <div id="footer">
Generated on Sun Mar 16 16:36:51 2014 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.7.3 (ruby-2.1.1).

</div>

</body>

</html>