本文整理汇总了PHP中Network::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Network::add方法的具体用法?PHP Network::add怎么用?PHP Network::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network::add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateGlobalDropdowns
/** Generate bigdump : generate global dropdowns
**/
function generateGlobalDropdowns() {
global $MAX, $DB;
$items = array("CD", "CD-RW", "DVD-R", "DVD+R", "DVD-RW", "DVD+RW", "ramette papier",
"disk'ette", "ZIP");
$dp = new ConsumableItemType();
for ($i=0 ; $i<$MAX['consumable_type'] ; $i++) {
if (isset($items[$i])) {
$val = $items[$i];
} else {
$val = "type d' consommable $i";
}
$dp->add(toolbox::addslashes_deep(array('name' => $val,
'comment' => "comment $val")));
}
$items = array("phone d'power");
$dp = new PhonePowerSupply();
for ($i=0 ; $i<$MAX['phone_power'] ; $i++) {
if (isset($items[$i])) {
$val = $items[$i];
} else {
$val = "power ' $i";
}
$dp->add(toolbox::addslashes_deep(array('name' => $val,
'comment' => "comment $val")));
}
$items = array("Grand", "Moyen", "Mic'ro", "1U", "5U");
$dp = new DeviceCaseType();
for ($i=0 ; $i<$MAX['case_type'] ; $i++) {
if (isset($items[$i])) {
$val = $items[$i];
} else {
$val = "power ' $i";
}
$dp->add(toolbox::addslashes_deep(array('name' => $val,
'comment' => "comment $val")));
}
$items = array("Laser", "Jet d'Encre", "Encre Solide");
$dp = new CartridgeItemType();
for ($i=0 ; $i<$MAX['cartridge_type'] ; $i++) {
if (isset($items[$i])) {
$val = $items[$i];
} else {
$val = "type d' cartouche $i";
}
$dp->add(toolbox::addslashes_deep(array('name' => $val,
'comment' => "comment $val")));
}
$items = array("Technicien", "Commercial", "Technico-Commercial", "President", "Secretaire",
"Directeur d'agence");
$dp = new ContactType();
for ($i=0 ; $i<$MAX['contact_type'] ; $i++) {
if (isset($items[$i])) {
$val = $items[$i];
} else {
$val = "type d' contact $i";
}
$dp->add(toolbox::addslashes_deep(array('name' => $val,
'comment' => "comment $val")));
}
$items = array("Maintenance", "Support", "Location", "Adhesion");
$dp = new ContractType();
for ($i=0 ; $i<$MAX['contract_type'] ; $i++) {
if (isset($items[$i])) {
$val = $items[$i];
} else {
$val = "type d' crontact $i";
}
$dp->add(toolbox::addslashes_deep(array('name' => $val,
'comment' => "comment $val")));
}
$items = array("Fournisseur", "Transporteur", "SSII", "Revendeur d'", "Assembleur", "SSLL",
"Financeur", "Assureur");
$dp = new SupplierType();
for ($i=0 ; $i<$MAX['enttype'] ; $i++) {
if (isset($items[$i])) {
$val = $items[$i];
} else {
$val = "type d'entreprise $i";
}
$dp->add(toolbox::addslashes_deep(array('name' => $val,
'comment' => "comment $val")));
}
$items = array("H.07.02", "I.07.56", "P51", "P52", "1.60", "4.06", "43-4071299", "1.0.14",
//.........这里部分代码省略.........
示例2: Network
<?php
/**
* Simple MyANN neural network setup example for testing
*/
include_once 'includes/network.inc';
// Instantiate the network
$network = new Network();
// Build three different layers
$network->add(4, "Inpt");
// input layer
$network->add(3, "Sigmoid");
// "hidden" layer
$network->add(1, "Sigmoid");
// output layer
// Do stuff here
$dump1 = $network->export();
print_r($dump1);
print "\n\n";
$network2 = new Network();
$network2->import($dump1);
/*
$dump2 = $network->export();
print_r($dump2);
print "\n\n";
print_r(($dump1 == $dump2));
print "\n";