<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='optosf1'>
<!--  @(#)optosf.1 2001/04/02 NIST -->
<!--  I Image Group -->
<!--  G. T. Candela &amp; Craig I. Watson -->

<refmeta>
<refentrytitle>OPTOSF</refentrytitle>
<manvolnum>1A</manvolnum>
<refmiscinfo class='date'>02 April 2001</refmiscinfo>
<refmiscinfo class='source'>NIST</refmiscinfo>
<refmiscinfo class='manual'>NFIS Reference Manual</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>optosf</refname>
<refpurpose>optimizes the overall smoothing factor for the PNN classifier.</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
  <command>optosf</command>    
    <arg choice='plain'><replaceable>&lt;prsfile&gt;</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>


<refsect1 id='description'><title>DESCRIPTION</title>
<para><emphasis remap='B'>Optosf</emphasis>
optimizes the overall smoothing factor (osf) for the Probabilistic
Neural Network (PNN) classifier.</para>

<para>The regional weights are optimized using the <emphasis remap='B'>optrws</emphasis> command.  To
save optrws runtime, it is suggested that optrws be run using the K-L
feature vectors of only a reasonably small set of fingerprints,
perhaps a small subset of the full prototype set that will be used in
the finished classifier.  But then, after the full prototype set of
feature vectors is made by transforming previously made orientation
arrays using the transform matrix incorporating the optimized regional
weights, one can expect that the classifier that uses these feature
vectors will be slightly more accurate if it uses an overall smoothing
factor slightly larger than 1, to compensate for the fact that the
prototype set is larger than it was during optimization of the
regional weights.  During optimization of the regional weights, no
explicit overall smoothing factor is used, since any effect such a
factor would have had could equally well be produced by just using
different values of the regional weights; so, optrws in effect fixes
the overall smoothing factor at 1.</para>

<para>The optosf command is provided to optimize the overall smoothing factor
for best results on the full set of prototypes.  It optimizes osf
by attempting to find a minimum (or at least a local minimum)
of an activation error rate that results when a set of finished
feature vectors is classified by PNN.  The set of prototypes
used by the PNN, during this optimization, is a superset of the
set on which the activation error rate is computed: both sets
start at the beginning of the provided data, but they are of different
lengths.  Whichever fingerprint the classifier is running on is
temporarily left out of the prototypes set, i.e. a leave-one-out method
is used in order to simulate a realistic situation.</para>

<para>The optimization method used is a very simple one, consisting of
taking steps of an initial size, then halving the stepsize and
reversing direction if the error rates ceases to decrease, etc.  This
method, while obviously not sufficient for the general problem of
minimizing a real function of one real variable, appears to be
sufficient for this particular problem, since the activation error
rate as a function of the osf seems to always have a unimodal form.</para>
</refsect1>

<refsect1 id='options'><title>OPTIONS</title>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>&lt;prsfile&gt;</emphasis></term>
  <listitem>
<para>A file specifying values of some or all of the parameters.  Parameters
not specified in this file assume default values.  To find out what
the parameters are, and as an example of the format of a parameters
file, see the file <filename>pcasys/parms/optosf.prs</filename> in the PARAMETER
FILES section below.  The user's <emphasis remap='I'>prsfile</emphasis> must specify values
for those parameters that <emphasis remap='I'>optosf.prs</emphasis> indicates have no defaults;
it can also specify default-overriding values for one or more of
the parameters that have defaults.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='parameter_files'><title>PARAMETER FILES</title>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>pcasys/parms/optosf.prs</emphasis></term>
  <listitem>
<para>Contains default values of the parameters for optosf (optimize overall
smoothing factor command).  Parameters with no defaults must be set in
the users <emphasis remap='I'>prsfile</emphasis>.</para>
  </listitem>
  </varlistentry>
</variablelist>

<!-- .RS -->
<para><emphasis remap='B'>Default settings in </emphasis><emphasis remap='I'>pcasys/parms/optosf.prs</emphasis></para>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='B'>n_feats_use </emphasis><literal>64</literal></term>
  <listitem>
<para>How many (first) features of the feature vectors to use.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='B'>osf_init </emphasis><literal>.1</literal></term>
  <listitem>
<para>Initial value for osf (overall smoothing factor).</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='B'>osf_initstep </emphasis><literal>.2</literal></term>
  <listitem>
<para>Initial step size for osf.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='B'>osf_stepthr </emphasis><literal>.01</literal></term>
  <listitem>
<para>Program stops when step size becomes &lt;= this value.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='B'>tablesize </emphasis><literal>1000</literal></term>
  <listitem>
<para>Size of the table used to avoid redundant computing.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='B'>verbose </emphasis><emphasis remap='I'>y</emphasis></term>
  <listitem>
<para>If y, write progress messages to stdout.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='B'>outfile_desc </emphasis><emphasis remap='I'>-</emphasis></term>
  <listitem>
<para>A - (hyphen) means let optosf make the description; otherwise,
value is the description.</para>

  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='B'>fvs_file </emphasis><emphasis remap='I'>(no default, user must set)</emphasis></term>
  <listitem>
<para>The file containing the prototype feature vectors, each vector
stored as one row of the matrix.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='B'>classes_file </emphasis><emphasis remap='I'>(no default, user must set)</emphasis></term>
  <listitem>
<para>The file containing the classes of the prototype feature vectors.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='B'>n_fvs_use_as_protos_set </emphasis><emphasis remap='I'>(no default, user must set)</emphasis></term>
  <listitem>
<para>The number of first feature vectors from fvs_file to use as the
PNN prototypes when optimizing osf.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='B'>n_fvs_use_as_tuning_set </emphasis><emphasis remap='I'>(no default, user must set)</emphasis></term>
  <listitem>
<para>The number of first feature vectors from fvs_file to run the
PNN on to optimize osf.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='B'>outfile </emphasis><emphasis remap='I'>(no default, user must set)</emphasis></term>
  <listitem>
<para>The results output file.</para>



  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='examples'><title>EXAMPLE(S)</title>
<para>From <emphasis remap='I'>test/pcasys/execs/optosf/optosf.src</emphasis>:</para>

<!-- .RS -->
<para><emphasis remap='B'>% optosf optosf.prs</emphasis>
<!-- .br -->
Optimize the overall smoothing factor based on the parameters
set in the file <filename>optosf.prs</filename>.</para>
</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para>optrws (1A)</para>


</refsect1>

<refsect1 id='author'><title>AUTHOR</title>
<para>NIST/ITL/DIV894/Image Group</para>
</refsect1>
</refentry>

