mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-27 06:18:56 +00:00

Fix all outstanding strict whitespace errors flagged by the online editor git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@331331 c90b9560-bf6c-de11-be94-00142212c4b1
140 lines
4.1 KiB
XML
140 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
|
|
<refentry xml:id="function.fann-create-train-from-callback" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>fann_create_train_from_callback</refname>
|
|
<refpurpose>Creates the training data struct from a user supplied function</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>resource</type><methodname>fann_create_train_from_callback</methodname>
|
|
<methodparam><type>int</type><parameter>num_data</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>num_input</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>num_output</parameter></methodparam>
|
|
<methodparam><type>collable</type><parameter>user_function</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Creates the training data struct from a user supplied function. As the training data are numerable (data 1, data 2...),
|
|
the user must write a function that receives the number of the training data set (input, output) and returns the set.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>num_data</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The number of training data
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>num_input</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The number of inputs per training data
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>num_output</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The number of ouputs per training data
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>user_function</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The user supplied function with following parameters:
|
|
<simplelist>
|
|
<member><literal>num</literal> - The number of the training data set</member>
|
|
<member><literal>num_input</literal> - The number of inputs per training data</member>
|
|
<member><literal>num</literal> - The number of ouputs per training dataThe number of inputs per training data</member>
|
|
</simplelist>
|
|
</para>
|
|
<para>
|
|
The function should return an associative array with keys <literal>input</literal> and <literal>output</literal> and
|
|
two array values of input and output.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
&fann.return.train;
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><methodname>fann_create_train_from_callback</methodname> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
function create_train_callback($num_data, $num_input, $num_output) {
|
|
return array(
|
|
"input" => array_fill(0, $num_input, 1),
|
|
"output" => array_fill(0, $num_output, 1),
|
|
);
|
|
}
|
|
|
|
$num_data = 3;
|
|
$num_input = 2;
|
|
$num_output = 1;
|
|
$train_data = fann_create_train_from_callback($num_data, $num_input, $num_output, "create_train_callback");
|
|
if ($train_data) {
|
|
// Do something with $train_data
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>fann_read_train_from_file</function></member>
|
|
<member><function>fann_train_on_data</function></member>
|
|
<member><function>fann_destroy_train</function></member>
|
|
<member><function>fann_save_train</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|