<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>BiasNeuron.html - rubyneat 0.3.4</title> <link href="../../../fonts.css" rel="stylesheet"> <link href="../../../rdoc.css" rel="stylesheet"> <script type="text/javascript"> var rdoc_rel_prefix = "../../../"; </script> <script src="../../../js/jquery.js"></script> <script src="../../../js/navigation.js"></script> <script src="../../../js/search_index.js"></script> <script src="../../../js/search.js"></script> <script src="../../../js/searcher.js"></script> <script src="../../../js/darkfish.js"></script> <body id="top" role="document" class="file"> <nav role="navigation"> <div id="project-navigation"> <div id="home-section" role="region" title="Quick navigation" class="nav-section"> <h2> <a href="../../../index.html" rel="home">Home</a> </h2> <div id="table-of-contents-navigation"> <a href="../../../table_of_contents.html#pages">Pages</a> <a href="../../../table_of_contents.html#classes">Classes</a> <a href="../../../table_of_contents.html#methods">Methods</a> </div> </div> <div id="search-section" role="search" class="project-section initially-hidden"> <form action="#" method="get" accept-charset="utf-8"> <div id="search-field-wrapper"> <input id="search-field" role="combobox" aria-label="Search" aria-autocomplete="list" aria-controls="search-results" type="text" name="search" placeholder="Search" spellcheck="false" title="Type to search, Up and Down to navigate, Enter to load"> </div> <ul id="search-results" aria-label="Search Results" aria-busy="false" aria-expanded="false" aria-atomic="false" class="initially-hidden"></ul> </form> </div> </div> <div id="project-metadata"> <div id="fileindex-section" class="nav-section"> <h3>Pages</h3> <ul class="link-list"> <li><a href="../../../Gemfile.html">Gemfile</a> <li><a href="../../../Gemfile_lock.html">Gemfile.lock</a> <li><a href="../../../Guardfile.html">Guardfile</a> <li><a href="../../../Rakefile.html">Rakefile</a> <li><a href="../../../doc/ControllerPoint_html.html">ControllerPoint.html</a> <li><a href="../../../doc/CuteA_html.html">CuteA.html</a> <li><a href="../../../doc/CuteB_html.html">CuteB.html</a> <li><a href="../../../doc/DSL_html.html">DSL.html</a> <li><a href="../../../doc/NEAT_html.html">NEAT.html</a> <li><a href="../../../doc/NEAT/BasicNeuronTypes_html.html">BasicNeuronTypes.html</a> <li><a href="../../../doc/NEAT/BasicNeuronTypes/BiasNeuron_html.html">BiasNeuron.html</a> <li><a href="../../../doc/NEAT/BasicNeuronTypes/CosineNeuron_html.html">CosineNeuron.html</a> <li><a href="../../../doc/NEAT/BasicNeuronTypes/InputNeuron_html.html">InputNeuron.html</a> <li><a href="../../../doc/NEAT/BasicNeuronTypes/SigmoidNeuron_html.html">SigmoidNeuron.html</a> <li><a href="../../../doc/NEAT/BasicNeuronTypes/SineNeuron_html.html">SineNeuron.html</a> <li><a href="../../../doc/NEAT/BasicNeuronTypes/TanhNeuron_html.html">TanhNeuron.html</a> <li><a href="../../../doc/NEAT/Controller_html.html">Controller.html</a> <li><a href="../../../doc/NEAT/Controller/NeatSettings_html.html">NeatSettings.html</a> <li><a href="../../../doc/NEAT/Critter_html.html">Critter.html</a> <li><a href="../../../doc/NEAT/Critter/Genotype_html.html">Genotype.html</a> <li><a href="../../../doc/NEAT/Critter/Genotype/Gene_html.html">Gene.html</a> <li><a href="../../../doc/NEAT/Critter/Phenotype_html.html">Phenotype.html</a> <li><a href="../../../doc/NEAT/DSL_html.html">DSL.html</a> <li><a href="../../../doc/NEAT/Evaluator_html.html">Evaluator.html</a> <li><a href="../../../doc/NEAT/Evolver_html.html">Evolver.html</a> <li><a href="../../../doc/NEAT/Evolver/CritterOp_html.html">CritterOp.html</a> <li><a href="../../../doc/NEAT/Expressor_html.html">Expressor.html</a> <li><a href="../../../doc/NEAT/Graph_html.html">Graph.html</a> <li><a href="../../../doc/NEAT/Graph/DependencyResolver_html.html">DependencyResolver.html</a> <li><a href="../../../doc/NEAT/Graph/GraphException_html.html">GraphException.html</a> <li><a href="../../../doc/NEAT/NeatException_html.html">NeatException.html</a> <li><a href="../../../doc/NEAT/NeatOb_html.html">NeatOb.html</a> <li><a href="../../../doc/NEAT/Neuron_html.html">Neuron.html</a> <li><a href="../../../doc/NEAT/Operator_html.html">Operator.html</a> <li><a href="../../../doc/NEAT/Population_html.html">Population.html</a> <li><a href="../../../doc/NEAT/Trait_html.html">Trait.html</a> <li><a href="../../../doc/_index_html.html">_index.html</a> <li><a href="../../../doc/class_list_html.html">class_list.html</a> <li><a href="../../../doc/css/common_css.html">common.css</a> <li><a href="../../../doc/css/full_list_css.html">full_list.css</a> <li><a href="../../../doc/css/style_css.html">style.css</a> <li><a href="../../../doc/file_list_html.html">file_list.html</a> <li><a href="../../../doc/frames_html.html">frames.html</a> <li><a href="../../../doc/index_html.html">index.html</a> <li><a href="../../../doc/js/app_js.html">app.js</a> <li><a href="../../../doc/js/full_list_js.html">full_list.js</a> <li><a href="../../../doc/js/jquery_js.html">jquery.js</a> <li><a href="../../../doc/method_list_html.html">method_list.html</a> <li><a href="../../../doc/top-level-namespace_html.html">top-level-namespace.html</a> <li><a href="../../../foo_dump_log.html">foo.dump.log</a> <li><a href="../../../rubyneat_gemspec.html">rubyneat.gemspec</a> <li><a href="../../../xordebug_log.html">xordebug.log</a> <li><a href="../../../xorsin_log.html">xorsin.log</a> </ul> </div> </div> </nav> <main role="main" aria-label="Page doc/NEAT/BasicNeuronTypes/BiasNeuron.html"> <p><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”</p> <pre>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></pre> <p><html xmlns=“<a href="http://www.w3.org/1999/xhtml">www.w3.org/1999/xhtml</a>” xml:lang=“en” lang=“en”></p> <pre><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></pre> <p><title></p> <pre>Class: NEAT::BasicNeuronTypes::BiasNeuron &mdash; Documentation by YARD 0.8.7.3</pre> <p></title></p> <pre><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" /></pre> <p><script type=“text/javascript” charset=“utf-8”></p> <pre>hasFrames = window.top.frames.main ? true : false; relpath = '../../'; framesUrl = "../../frames.html#!" + escape(window.location.href);</pre> <p></script></p> <pre><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 (B)</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">BiasNeuron</span> <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div></pre> <p></div></p> <pre> <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></pre> <p></div></p> <pre> <div class="clear"></div> </div> <iframe id="search_frame"></iframe> <div id="content"><h1>Class: NEAT::BasicNeuronTypes::BiasNeuron</pre> <p></h1></p> <p><dl class=“box”></p> <pre><dt class="r1">Inherits:</dt> <dd class="r1"> <span class="inheritName"><span class='object_link'><a href="InputNeuron.html" title="NEAT::BasicNeuronTypes::InputNeuron (class)">InputNeuron</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"><span class='object_link'><a href="InputNeuron.html" title="NEAT::BasicNeuronTypes::InputNeuron (class)">InputNeuron</a></span></li> <li class="next">NEAT::BasicNeuronTypes::BiasNeuron</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></pre> <p></dl> <div class=“clear”></div></p> <p><h2>Overview</h2><div class=“docstring”></p> <pre><div class="discussion"></pre> <p><h1 id=“label-Special+class+of+neuron+that+provides+a+bias+signal.”>Special class of neuron that provides a bias signal.</h1></p> <p><p>FIXME: The bias value is not behaving as expected because FIXME: the instance is not the neuron, but the phenotype.</p></p> <pre></div></pre> <p></div> <div class=“tags”></p> <p></div></p> <pre><h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2> <ul class="summary"> <li class="public "> <span class="summary_signature"> <a href="#neu_bias-instance_method" title="#neu_bias (instance method)">- (Object) <strong>neu_bias</strong> </a> </span> <span class="summary_desc"><div class='inline'></pre> <p><p>Returns the value of attribute neu_bias.</p> </div></span></p> <p></li></p> <pre class="ruby"><span class="ruby-operator"><</span><span class="ruby-regexp">/ul> <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../</span><span class="ruby-constant">Neuron</span>.<span class="ruby-identifier">html</span><span class="ruby-string">" title="</span><span class="ruby-constant">NEAT</span><span class="ruby-operator">::</span><span class="ruby-constant">Neuron</span> (<span class="ruby-identifier">class</span>)<span class="ruby-string">">Neuron</a></span></h3> <p class="</span><span class="ruby-identifier">inherited</span><span class="ruby-string">"><span class='object_link'><a href="</span><span class="ruby-operator">..</span><span class="ruby-node">/Neuron.html#genotype-instance_method" title="NEAT::Neuron#genotype (method)">#genotype</</span><span class="ruby-identifier">a</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-regexp">/span>, <span class='object_link'><a href="../</span><span class="ruby-constant">Neuron</span>.<span class="ruby-identifier">html</span><span class="ruby-comment">#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></span> <span class="ruby-operator"><</span><span class="ruby-identifier">h3</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">"inherited"</span><span class="ruby-operator">></span><span class="ruby-constant">Attributes</span> <span class="ruby-identifier">inherited</span> <span class="ruby-identifier">from</span> <span class="ruby-operator"><</span><span class="ruby-identifier">span</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">'object_link'</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-identifier">a</span> <span class="ruby-identifier">href</span>=<span class="ruby-string">"../NeatOb.html"</span> <span class="ruby-identifier">title</span>=<span class="ruby-string">"NEAT::NeatOb (class)"</span><span class="ruby-operator">></span><span class="ruby-constant">NeatOb</span><span class="ruby-operator"><</span><span class="ruby-regexp">/a></s</span><span class="ruby-identifier">pan</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-regexp">/h3> <p class="inherited"><span class='object_link'><a href="../</span><span class="ruby-constant">NeatOb</span>.<span class="ruby-identifier">html</span><span class="ruby-comment">#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></span> <span class="ruby-operator"><</span><span class="ruby-identifier">h2</span><span class="ruby-operator">></span> <span class="ruby-constant">Class</span> <span class="ruby-constant">Method</span> <span class="ruby-constant">Summary</span> <span class="ruby-operator"><</span><span class="ruby-identifier">small</span><span class="ruby-operator">></span>(<span class="ruby-operator"><</span><span class="ruby-identifier">a</span> <span class="ruby-identifier">href</span>=<span class="ruby-node">"#"</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">"summary_toggle"</span><span class="ruby-operator">></span><span class="ruby-identifier">collapse</span><span class="ruby-operator"><</span><span class="ruby-regexp">/a>)</sm</span><span class="ruby-identifier">all</span><span class="ruby-operator">></span> <span class="ruby-operator"><</span><span class="ruby-node">/h2> <ul class="summary"> <li class="public "> <span class="summary_signature"> <a href="#bias%3F-class_method" title="bias? (class method)">+ (Boolean) <strong>bias?</s</span><span class="ruby-identifier">trong</span><span class="ruby-operator">></span> <span class="ruby-operator"><</span><span class="ruby-regexp">/a> </s</span><span class="ruby-identifier">pan</span><span class="ruby-operator">></span> <span class="ruby-operator"><</span><span class="ruby-identifier">span</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">"summary_desc"</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-identifier">div</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">'inline'</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-regexp">/div></s</span><span class="ruby-identifier">pan</span><span class="ruby-operator">></span> </pre> <p></li></p> <pre> </ul> <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'></pre> <p><p>Just provides a bias signal FIXME: we had to hard-code the value here for now.</p> </div></span></p> <p></li></p> <pre> <li class="public "> <span class="summary_signature"> <a href="#initialize-instance_method" title="#initialize (instance method)">- (BiasNeuron) <strong>initialize</strong>(c = nil, n = nil) </a> </span> <span class="note title constructor">constructor</span> <span class="summary_desc"><div class='inline'></pre> <p><p>A new instance of BiasNeuron.</p> </div></span></p> <p></li></p> <pre> </ul> <h3 class="inherited">Methods inherited from <span class='object_link'><a href="InputNeuron.html" title="NEAT::BasicNeuronTypes::InputNeuron (class)">InputNeuron</a></span></h3> <p class="inherited"><span class='object_link'><a href="InputNeuron.html#input%3F-class_method" title="NEAT::BasicNeuronTypes::InputNeuron.input? (method)">input?</a></span></p> <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#inherited-class_method" title="NEAT::Neuron.inherited (method)">inherited</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#input%3F-class_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#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> <div class="method_details first"> <h3 class="signature first" id="initialize-instance_method"> - (<tt><span class='object_link'><a href="" title="NEAT::BasicNeuronTypes::BiasNeuron (class)">BiasNeuron</a></span></tt>) <strong>initialize</strong>(c = nil, n = nil)</pre> <p></h3><div class=“docstring”></p> <pre><div class="discussion"></pre> <p><p>Returns a new instance of BiasNeuron</p></p> <pre></div></pre> <p></div> <div class=“tags”></p> <p></div><table class=“source_code”></p> <pre><tr> <td> <pre class="lines"></pre> <p>93 94 95 96</pre></p> <pre></td> <td> <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 93</span></pre> <p><span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_c'>c</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_n'>n</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span></p> <pre><span class='kw'>super</span> <span class='ivar'>@neu_bias</span> <span class='op'>=</span> <span class='float'>1.00</span></pre> <p><span class='kw'>end</span></pre></p> <pre> </td> </tr></pre> <p></table> </div></p> <p></div></p> <pre><div id="instance_attr_details" class="attr_details"> <h2>Instance Attribute Details</h2> <span id="neu_bias=-instance_method"></span> <div class="method_details first"> <h3 class="signature first" id="neu_bias-instance_method"> - (<tt>Object</tt>) <strong>neu_bias</strong></pre> <p></h3><div class=“docstring”></p> <pre><div class="discussion"></pre> <p><p>Returns the value of attribute neu_bias</p></p> <pre></div></pre> <p></div> <div class=“tags”></p> <p></div><table class=“source_code”></p> <pre><tr> <td> <pre class="lines"></pre> <p>91 92 93</pre></p> <pre></td> <td> <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 91</span></pre> <p><span class='kw'>def</span> <span class='id identifier rubyid_neu_bias'>neu_bias</span></p> <pre><span class='ivar'>@neu_bias</span></pre> <p><span class='kw'>end</span></pre></p> <pre> </td> </tr></pre> <p></table> </div></p> <pre></div> <div id="class_method_details" class="method_details_list"> <h2>Class Method Details</h2> <div class="method_details first"> <h3 class="signature first" id="bias?-class_method"> + (<tt>Boolean</tt>) <strong>bias?</strong></pre> <p></h3><div class=“docstring”></p> <pre><div class="discussion"> </div></pre> <p></div> <div class=“tags”></p> <p><p class=“tag_title”>Returns:</p> <ul class=“return”></p> <pre><li> <span class='type'>(<tt>Boolean</tt>)</span> </li></pre> <p></ul></p> <p></div><table class=“source_code”></p> <pre><tr> <td> <pre class="lines"></pre> <p>90</pre></p> <pre></td> <td> <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 90</span></pre> <p><span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_bias?'>bias?</span> <span class='semicolon'>;</span> <span class='kw'>true</span> <span class='semicolon'>;</span> <span class='kw'>end</span></pre></p> <pre> </td> </tr></pre> <p></table> </div></p> <pre></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)</pre> <p></h3><div class=“docstring”></p> <pre><div class="discussion"></pre> <p><p>Just provides a bias signal FIXME: we had to hard-code the value here for now. Not a biggie, FIXME: but really should be @neu_bias</p></p> <pre></div></pre> <p></div> <div class=“tags”></p> <p></div><table class=“source_code”></p> <pre><tr> <td> <pre class="lines"></pre> <p>101 102 103</pre></p> <pre></td> <td> <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 101</span></pre> <p><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></p> <pre><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='float'>1.00</span> <span class='rbrace'>}</span></pre> <p><span class='kw'>end</span></pre></p> <pre> </td> </tr></pre> <p></table> </div></p> <pre></div></pre> <p></div></p> <pre> <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).</pre> <p></div></p> <pre></body></pre> <p></html></p> </main> <footer id="validator-badges" role="contentinfo"> <p><a href="http://validator.w3.org/check/referer">Validate</a> <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1. <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>. </footer>