FemProcess
The GeMA Fem Process Plugin
gmpFemNeuralNetwork.h
Go to the documentation of this file.
1 /************************************************************************
2 **
3 ** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4 ** All rights reserved.
5 **
6 ** This file is part of the "GeMA" software. It's use should respect
7 ** the terms in the license agreement that can be found together
8 ** with this source code.
9 ** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10 ** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11 ** A PARTICULAR PURPOSE.
12 **
13 ************************************************************************/
14 
24 #ifndef _GEMA_PLUGIN_FEM_NEURAL_NETWORK_H_
25 #define _GEMA_PLUGIN_FEM_NEURAL_NETWORK_H_
26 
27 #include "gmpFemProcessConfig.h"
28 #include <assert.h>
29 #include <gmLog.h>
30 #include <QList>
31 #include "gmVector.h"
32 #include "gmMatrix.h"
33 
35 class GMP_FEM_PROCESS_API_EXPORT GmpFemNeuralNetwork
36 {
37 public:
38  GmpFemNeuralNetwork(const GmLogCategory& logger);
39 
40  virtual ~GmpFemNeuralNetwork();
41 
43  bool loadNetArchitecture(LuaTable& table);
44 
46  bool loadNetWeights(LuaTable& table);
47 
49  bool loadNetBias(LuaTable& table);
50 
52  bool loadNetInputSettings(LuaTable& table);
53 
55  bool loadNetOutputSettings(LuaTable& table);
56 
58  GmMatrix* readNetWeight(int i) { return &_netWeights[i]; }
59 
61  bool predict(GmVector& x, GmVector& y);
62 
64  bool normalization(GmVector& x, GmVector& xn);
65 
67  bool inverseNormalization(GmVector& x, GmVector& xn);
68 
70  GmVector tanh(GmVector& x);
71 
73  GmVector logsig(GmVector& x);
74 
76  int stringOptionIndex(QString value, const char** optionNames);
77 
78 private:
79  const char** activationFcnOptions();
86 
88 
89 };
90 
91 #endif
GmMatrix * readNetWeight(int i)
reads weight at position i
Definition: gmpFemNeuralNetwork.h:58
GmMatrix _outputSettings
Matrix with {min, max} of output variables (output range)
Definition: gmpFemNeuralNetwork.h:82
GmMatrix _inputsettings
Matrix with {min, max} of input variables (input range)
Definition: gmpFemNeuralNetwork.h:81
const GmLogCategory & _logger
Reference to the plugin private logger.
Definition: gmpFemNeuralNetwork.h:87
QList< GmVector > _netBias
List with neural bias.
Definition: gmpFemNeuralNetwork.h:84
GmVector _netConf
Vector to define the ANN architecture.
Definition: gmpFemNeuralNetwork.h:80
QList< GmMatrix > _netWeights
List with neural weights.
Definition: gmpFemNeuralNetwork.h:85
A simple class to store additional Data required by Fem physics.
Definition: gmpFemNeuralNetwork.h:35
QList< QString > _activationFcn
List with activation functions.
Definition: gmpFemNeuralNetwork.h:83
int stringOptionIndex(QString value, const char **optionNames, lua_State *L, const char *fieldName)
arma::vec GmVector
Declaration of usefull configuration definitions for the plugin library.
arma::mat GmMatrix