本文整理匯總了PHP中Teacher::learn方法的典型用法代碼示例。如果您正苦於以下問題:PHP Teacher::learn方法的具體用法?PHP Teacher::learn怎麽用?PHP Teacher::learn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Teacher
的用法示例。
在下文中一共展示了Teacher::learn方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Normalization
define('PATH', __DIR__);
require_once '/lib/Neuron.php';
require_once '/lib/Normalization.php';
require_once '/lib/kcaptcha/KCaptcha.php';
require_once '/lib/Network.php';
require_once '/lib/Teacher.php';
echo '<script type="text/javascript" src="/js/jquery-1.11.3.min.js"></script>';
echo '<script type="text/javascript" src="/js/main.js"></script>';
echo '<h1>Neural Network</h1>';
$normalization = new Normalization(1200, 17000000, 0, 1);
$captcha = new KCaptcha();
$inputs = $normalization->import($captcha->getPoints());
$network = new Network();
$network->loadState('learned-1');
//$w = $network->getWeights(2);
/*
$outs1 = $network->calculate(1, $inputs);
$outs2 = $network->calculate(2, $outs1);
*/
/*
echo '<pre>';
var_dump($outs2);
echo '</pre>';
*/
$teacher = new Teacher($network);
$teacher->learn();
/*
$network->randomWeights(1, 8, 2925);
$network->randomWeights(2, 2, 8);
$network->saveState('30-08-2015');
*/