libeblearn
/home/rex/ebltrunk/core/libeblearn/include/net_cscscfe.h
00001 /***************************************************************************
00002  *   Copyright (C) 2008 by Yann LeCun and Pierre Sermanet *
00003  *   yann@cs.nyu.edu, pierre.sermanet@gmail.com *
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions are met:
00007  *     * Redistributions of source code must retain the above copyright
00008  *       notice, this list of conditions and the following disclaimer.
00009  *     * Redistributions in binary form must reproduce the above copyright
00010  *       notice, this list of conditions and the following disclaimer in the
00011  *       documentation and/or other materials provided with the distribution.
00012  *     * Redistribution under a license not approved by the Open Source
00013  *       Initiative (http://www.opensource.org) must display the
00014  *       following acknowledgement in all advertising material:
00015  *        This product includes software developed at the Courant
00016  *        Institute of Mathematical Sciences (http://cims.nyu.edu).
00017  *     * The names of the authors may not be used to endorse or promote products
00018  *       derived from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
00021  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00022  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00023  * DISCLAIMED. IN NO EVENT SHALL ThE AUTHORS BE LIABLE FOR ANY
00024  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00025  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00026  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00027  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00028  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00029  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00030  ***************************************************************************/
00031 
00032 #ifndef NET_CSCSCFE_H_
00033 #define NET_CSCSCFE_H_
00034 
00035 #include "libidx.h"
00036 #include "ebl_machines.h"
00037 
00038 namespace ebl {
00039 
00040 /*   //! full connection with Euclidean distance between replicable  */
00041 /*   //! 3D layers. This is like a layer of RBF WITHOUT NON-LINEAR FUNCTIONS. */
00042 /*   //! the output is the square Euclidean distance between the input */
00043 /*   //! and the weight */
00044 /*   //! the full connection is only across the first dimension  */
00045 /*   //! of the input and output layer. */
00046 /*   //! the other two dimensions are spatial dimensions accross which the  */
00047 /*   //! weight matrix is shared. */
00048 /*   template <class T> class e_layer : */
00049 /*   public module_1_1<state_idx<T>, state_idx<T> > */
00050 /*     { */
00051 /*     public: */
00052 /*       //! weight matrix */
00053 /*       state_idx<T> weight; */
00054 
00055 /*       virtual ~e_layer(void); */
00056 /*       //! new e-layer (Eucliden distance RBF). <tin> is the */
00057 /*       //! thickness of the input layer, <tout> is the thickness  */
00058 /*       //! of the output layer, <prm> is the parameter. */
00059 /*       e_layer(parameter &prm, intg tin, intg tout);   */
00060 /*       //! fprop from in to out */
00061 /*       void fprop(state_idx &in, state_idx<T> &out); */
00062 /*       //! bprop */
00063 /*       void bprop(state_idx<T> &in, state_idx<T> &out); */
00064 /*       //! bbprop */
00065 /*       void bbprop(state_idx<T> &in, state_idx<T> &out); */
00066 /*       //! initialize the weights to random values */
00067 /*       void forget(forget_param_linear &fp); */
00068 /*     }; */
00069 
00070 /*   //! Standard LeNet5-type architecture with the "RBF" layer on top */
00071 /*   template <class T> */
00072 /*     class net_cscscfe : public module_1_1<state_idx<T>, state_idx<T> > */
00073 /*     { */
00074 /*     public: */
00075 /*       net_cscscf     &net; */
00076 /*       state_idx<T>   netout; */
00077 /*       e_layer                &rbf; */
00078 
00079 /*       //! makes a new net_cscscfe module. */
00080 /*       //! <n> is a net-cscscf, <e> is an e-dist layer, */
00081 /*       //! <thick> is the number of outputs. */
00082 /*       //! <si>,<sj> are the initial replication factors. */
00083 /*       net_cscscfe(net_cscscf &n, e_layer &e, int thick, int si, int sj); */
00084 /*       virtual ~net_cscscfe(); */
00085 
00086 /*       //! initialize the weights to random values */
00087 /*       void forget(forget_param_linear &fp); */
00088 /*       //! fprop from in to out */
00089 /*       virtual void fprop(state_idx<T> &in, state_idx<T> &out); */
00090 /*       //! bprop */
00091 /*       virtual void bprop(state_idx<T> &in, state_idx<T> &out); */
00092 /*       //! bbprop */
00093 /*       virtual void bbprop(state_idx<T> &in, state_idx<T> &out); */
00094 /*     }; */
00095 
00096 } // end namespace ebl
00097 
00098 #endif /* NET_CSCSCFE_H_ */