Changeset 1130 for cpp/frams/neuro
- Timestamp:
- 04/16/21 15:55:34 (4 years ago)
- Location:
- cpp/frams/neuro/impl
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/neuro/impl/neuroimpl-channels.cpp
r907 r1130 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-20 15Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2021 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 5 5 #include "neuroimpl-channels.h" 6 #include < common/nonstd_stl.h>6 #include <algorithm> 7 7 8 8 void NI_Channelize::go() … … 18 18 if (c < 2) { setState(getWeightedInputState(1)); return; } 19 19 double s = getWeightedInputState(0); 20 s = ( max(-1.0,min(1.0, s)) + 1.0) / 2.0; // 0..120 s = (std::max(-1.0, std::min(1.0, s)) + 1.0) / 2.0; // 0..1 21 21 int i1; 22 i1 = (int)(s * (c - 1)); i1 = max(0,min(i1, c - 2));22 i1 = (int)(s * (c - 1)); i1 = std::max(0, std::min(i1, c - 2)); 23 23 double sw = 1.0 / (c - 1); 24 24 double s1 = sw * i1; -
cpp/frams/neuro/impl/neuroimpl-fuzzy-f0.cpp
r973 r1130 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-202 0Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2021 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 7 7 8 8 #include "neuroimpl-fuzzy-f0.h" 9 #include < common/nonstd_stl.h> //min,max9 #include <algorithm> 10 10 11 11 //this part concerns fuzzy sets transformation … … 132 132 return -1; 133 133 if ((k >= inNr) && ((k % 2) == 0)) 134 maxOutputNr = max(maxOutputNr, rules[j][k]);134 maxOutputNr = std::max(maxOutputNr, rules[j][k]); 135 135 } 136 136 } -
cpp/frams/neuro/impl/neuroimpl-fuzzy.cpp
r973 r1130 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-202 0Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2021 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 5 5 #include "neuroimpl-fuzzy.h" 6 6 #include "neuroimpl-fuzzy-f0.h" 7 #include <common/nonstd_stl.h> //min,max8 7 9 8 int NI_FuzzyNeuro::countOuts(const Model *m, const Neuro *fuzzy) … … 109 108 nrFuzzySet = rules[i][j * 2 + 1]; // j*2 moves pointer through each output, +1 moves to nr of fuzzy set 110 109 inputNr = rules[i][j * 2]; // as above but gives input number 111 minimumCut = min(minimumCut, TrapeziumFuzz(nrFuzzySet, getWeightedInputState(inputNr))); // value of membership function for this input and given fuzzy set110 minimumCut = std::min(minimumCut, TrapeziumFuzz(nrFuzzySet, getWeightedInputState(inputNr))); // value of membership function for this input and given fuzzy set 112 111 } 113 112 if ((minimumCut > 1) || (minimumCut < 0))
Note: See TracChangeset
for help on using the changeset viewer.