- fann-1_2_0.zip
- fann-1.2.0
- aclocal.m4
- AUTHORS
- benchmarks
- .cvsignore
- benchmark.sh
- benchmarks.pdf
- ctimer.h
- datasets
- building.test
- building.train
- diabetes.test
- diabetes.train
- gene.test
- gene.train
- mushroom.test
- mushroom.train
- parity13.test
- parity13.train
- parity8.test
- parity8.train
- pumadyn-32fm.test
- pumadyn-32fm.train
- robot.test
- robot.train
- soybean.test
- soybean.train
- thyroid.test
- thyroid.train
- two-spiral.test
- two-spiral.train
- gnuplot
- Makefile
- parity.c
- performance.cc
- quality.cc
- quality_fixed.c
- README
- shuffle.c
- two-spirals.c
- ChangeLog
- config.guess
- config.in
- config.sub
- configure
- configure.in
- COPYING
- debian
- changelog
- compat
- control
- copyright
- docs
- libfann1.dirs
- libfann1.files
- libfann1.install
- libfann1-dev.dirs
- libfann1-dev.examples
- libfann1-dev.files
- libfann1-dev.install
- rules
- depcomp
- doc
- examples
- fann.pc.in
- fann.spec.in
- INSTALL
- install-sh
- ltmain.sh
- Makefile.am
- Makefile.in
- missing
- mkinstalldirs
- MSVC++
- all.dsw
- libfann.dsp
- simple_test.dsp
- simple_train.dsp
- steepness_train.dsp
- xor_test.dsp
- xor_train.dsp
- NEWS
- python
- README
- src
- TODO
- win32_dll
- vs_net2003.zip
- VS.NET2003
- all.sln
- libfann.vcproj
- simple_test.vcproj
- simple_train.vcproj
- steepness_train.vcproj
- xor_test.vcproj
- xor_train.vcproj
- fann_win32_dll-1_2_0.zip
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML
><HEAD
><TITLE
>fann_train</TITLE
><link href="../style.css" rel="stylesheet" type="text/css"><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Fast Artificial Neural Network Library"
HREF="index.html"><LINK
REL="UP"
TITLE="API Reference"
HREF="x2553.html"><LINK
REL="PREVIOUS"
TITLE="fann_create"
HREF="r2555.html"><LINK
REL="NEXT"
TITLE="fann_save"
HREF="r2641.html"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Fast Artificial Neural Network Library</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="r2555.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="r2641.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.fann_train"
></A
>fann_train</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN2598"
></A
><H2
>Name</H2
>fann_train -- Train an artificial neural network.</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN2601"
></A
><H2
>Description</H2
><code
class="methodsynopsis"
> <span
class="type"
>bool </span
>fann_train(<span
class="methodparam"
><span
class="type"
>resource </span
><span
class="parameter"
>ann</span
></span
><span
class="methodparam"
>, <span
class="type"
>mixed </span
><span
class="parameter"
>data</span
></span
><span
class="methodparam"
>, <span
class="type"
>int </span
><span
class="parameter"
>max_iterations</span
></span
><span
class="methodparam"
>, <span
class="type"
>double </span
><span
class="parameter"
>desired_error</span
></span
><span
class="methodparam"
>, <span
class="type"
>int </span
><span
class="parameter"
>iterations_between_reports</span
></span
>); </code
><P
> <CODE
CLASS="function"
>fann_train</CODE
> will train <VAR
CLASS="parameter"
>ann</VAR
> on the data supplied, returning TRUE
on success or FALSE on failure.
</P
><P
> Resources is an artificial neural network returned by <CODE
CLASS="function"
>fann_create</CODE
>.
</P
><P
> <VAR
CLASS="parameter"
>data</VAR
> must be either an array of training data, or the URI of a properly formatted
training file.
</P
><P
> <CODE
CLASS="function"
>fann_train</CODE
> will continue training until <VAR
CLASS="parameter"
>desired_error</VAR
> is
reached, or <VAR
CLASS="parameter"
>max_iterations</VAR
> is exceeded.
</P
><P
> If <VAR
CLASS="parameter"
>iterations_between_reports</VAR
> is set, <CODE
CLASS="function"
>fann_create</CODE
> will output a
short progress report every <VAR
CLASS="parameter"
>iterations_between_reports</VAR
>. Default is 0 (meaning no
reports).
</P
><DIV
CLASS="example"
><A
NAME="example.php.fann_train"
></A
><P
><B
>Example 6-1.
<CODE
CLASS="function"
>fann_create</CODE
> from training data</B
></P
><PRE
CLASS="programlisting"
>
<?php
$ann = fann_create(array(2, 4, 1), 1.0, 0.7);
if ( fann_train($ann,
array(
array(
array(0,0), /* Input(s) */
array(0) /* Output(s) */
),
array(
array(0,1), /* Input(s) */
array(1) /* Output(s) */
),
array(
array(1,0), /* Input(s) */
array(1) /* Output(s) */
),
array(array(1,1), /* Input(s) */
array(0) /* Output(s) */
)
),
100000,
0.00001,
1000) == FALSE) {
exit('Could not train $ann.');
}
?>
</PRE
></DIV
><P
>This function appears in FANN-PHP >= 0.1.0.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="r2555.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="r2641.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>fann_create</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="x2553.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>fann_save</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.