<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.fann.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.fann-init-weights.php',
    1 => 'fann_init_weights',
    2 => '使用 Widrow 和 Nguyen 算法初始化权重。',
  ),
  'up' => 
  array (
    0 => 'ref.fann.php',
    1 => 'Fann 函数',
  ),
  'prev' => 
  array (
    0 => 'function.fann-get-training-algorithm.php',
    1 => 'fann_get_training_algorithm',
  ),
  'next' => 
  array (
    0 => 'function.fann-length-train-data.php',
    1 => 'fann_length_train_data',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/fann/functions/fann-init-weights.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.fann-init-weights" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">fann_init_weights</h1>
  <p class="verinfo">(PECL fann &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">fann_init_weights</span> &mdash; <span class="dc-title">使用 Widrow 和 Nguyen 算法初始化权重。</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.fann-init-weights-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>fann_init_weights</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$ann</code></span>, <span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$train_data</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   使用 Widrow 和 Nguyen 算法初始化权重。
  </p>
  <p class="para">
   该函数的作用和 <span class="function"><a href="function.fann-randomize-weights.php" class="function">fann_randomize_weights()</a></span>函数相似。 该函数将会使用
   Derrick Nguyen 和 Bernard Widrow 开发的算法来设置权重用于加速训练。 该技术不是经常奏效，在某些场景下比纯粹的随机初始化来得更低效。
  </p>
  <p class="para">
   该算法要求获取输入数据的范围(比如 最大和最小输入)，因此接受别的参数，数据(将会在网络中训练的数据)。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.fann-init-weights-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt><code class="parameter">ann</code></dt>
    <dd>
     <p class="para">神经网络 <span class="type">资源</span>。</p>
    </dd>
   
   
    <dt><code class="parameter">train_data</code></dt>
    <dd>
     <p class="para">神经网络训练数据 <span class="type">资源</span>。</p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.fann-init-weights-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">成功时返回 <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>，其它情况下返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。</p>
 </div>


  <div class="refsect1 seealso" id="refsect1-function.fann-init-weights-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.fann-randomize-weights.php" class="function" rel="rdfs-seeAlso">fann_randomize_weights()</a> - 给每个连接赋一个介于 min_weight 和 max_weight 之间的随机权重。</span></li>
    <li><span class="function"><a href="function.fann-read-train-from-file.php" class="function" rel="rdfs-seeAlso">fann_read_train_from_file()</a> - 读取存储训练数据的文件。</span></li>
   </ul>
  </p>
 </div>



</div><?php manual_footer($setup); ?>