Reinforcement Learning Toolbox 2.0
last updated:
General
Documentation
Manual
Tutorial
Class Reference
Master Thesis
Examples
Related Papers
Downloads
Links
News
mailto:webmaster
Main Page     Class Hierarchy   Compound List   File List   Compound Members   File Members

cadaptivesoftmaxnetwork.h

Go to the documentation of this file.
00001 // Copyright (C) 2003
00002 // Gerhard Neumann (gneumann@gmx.net)
00003 // Stephan Neumann (sneumann@gmx.net) 
00004 //                
00005 // This file is part of RL Toolbox.
00006 // http://www.igi.tugraz.at/ril_toolbox
00007 //
00008 // All rights reserved.
00009 // 
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions
00012 // are met:
00013 // 1. Redistributions of source code must retain the above copyright
00014 //    notice, this list of conditions and the following disclaimer.
00015 // 2. Redistributions in binary form must reproduce the above copyright
00016 //    notice, this list of conditions and the following disclaimer in the
00017 //    documentation and/or other materials provided with the distribution.
00018 // 3. The name of the author may not be used to endorse or promote products
00019 //    derived from this software without specific prior written permission.
00020 // 
00021 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00022 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00023 // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00024 // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00025 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00026 // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00027 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00028 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00029 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00030 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031 
00032 #ifndef C_ADAPTIVESOFTMAX__H
00033 #define C_ADAPTIVESOFTMAX__H
00034 
00035 #include <stdio.h> 
00036 #include <vector>
00037 #include <list>
00038 #include <map>
00039 
00040 #include "clearndataobject.h"
00041 #include "cstatemodifier.h"
00042 
00043 class CRBFBasisFunction;
00044 
00045 class DataSubset;
00046 class CDataSet;
00047 
00048 class CKDTree;
00049 class CKNearestNeighbors;
00050 
00051 class CStateCollection;
00052 class CState;
00053 class CStateProperties;
00054 
00055 class CRBFCenterNetwork : public CLearnDataObject
00056 {
00057         protected:
00058                 int numDim;
00059 
00060                 std::vector<CRBFBasisFunction*> *centers;
00061 
00062                 virtual void initNetwork() {};
00063 
00064                 CRBFCenterNetwork(std::vector<CRBFBasisFunction *> *centers, int numDim);
00065         public:
00066                 
00067                 CRBFCenterNetwork(int numDim);
00068 
00069                 virtual ~CRBFCenterNetwork();
00070 
00071                 virtual void getNearestNeigbors(ColumnVector *state, unsigned int K,  DataSubset *subset) = 0;
00072                 
00073                 virtual void saveData(FILE *stream);
00074                 virtual void loadData(FILE *stream);
00075 
00076                 virtual void resetData() {};
00077                         
00078                 CRBFBasisFunction *getCenter(int index);
00079                 int getNumCenters();
00080 
00081                 virtual void deleteCenters();
00082 
00083                 int getNumDimensions();
00084 };
00085 
00086 class CRBFCenterNetworkSimpleSearch : public CRBFCenterNetwork
00087 {
00088 protected:
00089                 virtual void initNetwork() {};
00090                 
00091                 
00092 public:
00093                 CRBFCenterNetworkSimpleSearch(int numDim);
00094 
00095                 virtual ~CRBFCenterNetworkSimpleSearch();
00096 
00097 
00098                 virtual void getNearestNeigbors(ColumnVector *state, unsigned int K,  DataSubset *subset);
00099 };
00100 
00101 class CRBFCenterNetworkKDTree : public CRBFCenterNetwork
00102 {
00103 protected:
00104                 CDataSet *dataset;
00105 
00106                 virtual void initNetwork();
00107 
00108                 unsigned int K;
00109                 
00110                 CKDTree *tree;
00111                 CKNearestNeighbors *nearestNeighbors;
00112 public:
00113                 CRBFCenterNetworkKDTree(int numDim, unsigned int K);
00114 
00115                 virtual ~CRBFCenterNetworkKDTree();
00116 
00117                 virtual void getNearestNeigbors(ColumnVector *state, unsigned int K,  DataSubset *subset);
00118 };
00119 
00120 class CRBFCenterFeatureCalculator : public CFeatureCalculator
00121 {
00122 protected:
00123         CRBFCenterNetwork *network;
00124 
00125 public:
00126         bool useBias;
00127         bool normalizeFeat;
00128 
00129         CRBFCenterFeatureCalculator(CStateProperties *stateProperties, CRBFCenterNetwork *network, unsigned int K);
00130         virtual ~CRBFCenterFeatureCalculator();
00131 
00132         virtual void getModifiedState(CStateCollection *state, CState *targetState);
00133 };
00134 
00135 
00136 #endif
00137