| 1 | /* FFNet_def.h |
| 2 | * |
| 3 | * Copyright (C) 1994-2018 David Weenink |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This code is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | /* |
| 20 | djmw 19961104 |
| 21 | djmw 20020712 GPL header |
| 22 | djmw 20060529 Added version number to oo_Collection |
| 23 | djmw 20080122 float -> double |
| 24 | */ |
| 25 | |
| 26 | #define ooSTRUCTcxx . . $ `FFNet/FFNet_def.h:26:9`! FFNet |
| 27 | oo_DEFINE_CLASScxx . . $ `sys/oo.h:176:9`! (FFNet, Daata) |
| 28 | |
| 29 | oo_INTEGERcxx . . $ `sys/oo.h:45:9`! (numberOfLayers) /* number of layers */ |
| 30 | oo_FROMcxx . . $ `sys/oo.h:202:9`! (1) |
| 31 | oo_INTEGERcxx . . $ `sys/oo.h:45:9`! (numberOfInputs) |
| 32 | oo_INTEGERcxx . . $ `sys/oo.h:45:9`! (numberOfOutputs) |
| 33 | oo_ENDFROMcxx . . $ `sys/oo.h:203:9`! |
| 34 | #if oo_READINGcxx . . $ `sys/oo.h:235:9`! |
| 35 | oo_VERSION_UNTIL (1) |
| 36 | oo_INTVEC (numberOfUnitsInLayer, numberOfLayers + 1) |
| 37 | numberOfInputs = numberOfUnitsInLayer [1]; |
| 38 | numberOfOutputs = numberOfUnitsInLayer [numberOfLayers + 1]; |
| 39 | for (integer ilayer = 1; ilayer <= numberOfLayers; ilayer ++) |
| 40 | numberOfUnitsInLayer [ilayer] = numberOfUnitsInLayer [ilayer + 1]; |
| 41 | numberOfUnitsInLayer. resize (numberOfLayers); |
| 42 | oo_VERSION_ELSE |
| 43 | oo_INTVEC (numberOfUnitsInLayer, numberOfLayers) |
| 44 | oo_VERSION_END |
| 45 | #else |
| 46 | oo_INTVECcxx . . $ `sys/oo.h:76:9`! (numberOfUnitsInLayer, numberOfLayers) |
| 47 | #endif |
| 48 | oo_INTcxx . . $ `sys/oo.h:44:9`! (outputsAreLinear) |
| 49 | oo_INTcxx . . $ `sys/oo.h:44:9`! (nonLinearityType) |
| 50 | oo_INTcxx . . $ `sys/oo.h:44:9`! (costFunctionType) |
| 51 | oo_COLLECTIONcxx . . $ `sys/oo.h:151:9`! (Categories, outputCategories, SimpleString, 0) |
| 52 | oo_INTEGERcxx . . $ `sys/oo.h:45:9`! (numberOfWeights) /* number of weights */ |
| 53 | oo_VECcxx . . $ `sys/oo.h:74:9`! (w, numberOfWeights) |
| 54 | |
| 55 | #if ! oo_READINGcxx . . $ `sys/oo.h:235:9`! && ! oo_WRITINGcxx . . $ `sys/oo.h:238:9`! && ! oo_COMPARINGcxx . . $ `sys/oo.h:233:9`! |
| 56 | oo_INTEGERcxx . . $ `sys/oo.h:45:9`! (numberOfNodes) |
| 57 | oo_INTEGERcxx . . $ `sys/oo.h:45:9`! (dimension) |
| 58 | |
| 59 | #if oo_DECLARINGcxx . . $ `sys/oo.h:230:9`! |
| 60 | double (*nonLinearitycxx . . $ structFFNet#nonLinearity.) (FFNetcxx . . $ FFNet# me, double x, double *deriv); |
| 61 | void *nlClosurecxx . . $ structFFNet#nlClosure.; |
| 62 | double (*costFunctioncxx . . $ structFFNet#costFunction.) (FFNetcxx . . $ FFNet# me, constVECcxx . . $ constVEC# const& target); |
| 63 | void *cfClosurecxx . . $ structFFNet#cfClosure.; |
| 64 | #endif |
| 65 | |
| 66 | #if oo_DECLARINGcxx . . $ `sys/oo.h:230:9`! |
| 67 | oo_DOUBLEcxx . . $ `sys/oo.h:58:9`! (accumulatedCost) |
| 68 | oo_INTEGERcxx . . $ `sys/oo.h:45:9`! (numberOfPatterns) |
| 69 | oo_INTEGERcxx . . $ `sys/oo.h:45:9`! (currentPattern) |
| 70 | MATcxx . . $ MAT# inputPatterncxx . . $ structFFNet#inputPattern., targetActivationcxx . . $ structFFNet#targetActivation.; |
| 71 | #endif |
| 72 | #if oo_DECLARINGcxx . . $ `sys/oo.h:230:9`! || oo_DESTROYINGcxx . . $ `sys/oo.h:231:9`! |
| 73 | oo_OBJECTcxx . . $ `sys/oo.h:149:9`! (Minimizer, 0, minimizer) |
| 74 | #endif |
| 75 | |
| 76 | oo_VECcxx . . $ `sys/oo.h:74:9`! (activity, numberOfNodes) |
| 77 | oo_INTVECcxx . . $ `sys/oo.h:76:9`! (isbias, numberOfNodes) |
| 78 | oo_INTVECcxx . . $ `sys/oo.h:76:9`! (nodeFirst, numberOfNodes) |
| 79 | oo_INTVECcxx . . $ `sys/oo.h:76:9`! (nodeLast, numberOfNodes) |
| 80 | oo_INTVECcxx . . $ `sys/oo.h:76:9`! (wFirst, numberOfNodes) |
| 81 | oo_INTVECcxx . . $ `sys/oo.h:76:9`! (wLast, numberOfNodes) |
| 82 | |
| 83 | oo_VECcxx . . $ `sys/oo.h:74:9`! (deriv, numberOfNodes) |
| 84 | oo_VECcxx . . $ `sys/oo.h:74:9`! (error, numberOfNodes) |
| 85 | oo_INTVECcxx . . $ `sys/oo.h:76:9`! (wSelected, numberOfWeights) |
| 86 | oo_VECcxx . . $ `sys/oo.h:74:9`! (dw, numberOfWeights) |
| 87 | oo_VECcxx . . $ `sys/oo.h:74:9`! (dwi, numberOfWeights) |
| 88 | #endif |
| 89 | |
| 90 | #if oo_READINGcxx . . $ `sys/oo.h:235:9`! |
| 91 | bookkeeping (this); |
| 92 | FFNet_setNonLinearity (this, nonLinearityType); |
| 93 | FFNet_setCostFunction (this, costFunctionType); |
| 94 | #endif |
| 95 | |
| 96 | #if oo_COPYINGcxx . . $ `sys/oo.h:232:9`! |
| 97 | thy nonLinearity = our nonLinearity; |
| 98 | thy nlClosure = our nlClosure; |
| 99 | thy costFunction = our costFunction; |
| 100 | thy cfClosure = our cfClosure; |
| 101 | #endif |
| 102 | |
| 103 | #if oo_DECLARINGcxx . . $ `sys/oo.h:230:9`! |
| 104 | void v1_infocxx . . $ structFFNet#v1_info(49f6e7a06ebc5aa8). () |
| 105 | override; |
| 106 | #endif |
| 107 | |
| 108 | oo_END_CLASScxx . . $ `sys/oo.h:186:9`! (FFNet) |
| 109 | #undef ooSTRUCTcxx . . $ `FFNet/FFNet_def.h:26:9`! |
| 110 | |
| 111 | /* End of file FFNet_def.h */ |