OpenNN  2.2
Open Neural Networks Library
bounding_layer.cpp
1 /****************************************************************************************************************/
2 /* */
3 /* OpenNN: Open Neural Networks Library */
4 /* www.artelnics.com/opennn */
5 /* */
6 /* B O U N D I N G L A Y E R C L A S S */
7 /* */
8 /* Roberto Lopez */
9 /* Artelnics - Making intelligent use of data */
11 /* */
12 /****************************************************************************************************************/
13 
14 // OpenNN includes
15 
16 #include "bounding_layer.h"
17 
18 namespace OpenNN
19 {
20 
21 // DEFAULT CONSTRUCTOR
22 
25 
27 {
28  set();
29 }
30 
31 
32 // BOUNDING NEURONS NUMBER CONSTRUCTOR
33 
37 
38 BoundingLayer::BoundingLayer(const size_t& bounding_neurons_number)
39 {
40  set(bounding_neurons_number);
41 
42  set_default();
43 }
44 
45 
46 // XML CONSTRUCTOR
47 
51 
52 BoundingLayer::BoundingLayer(const tinyxml2::XMLDocument& bounding_layer_document)
53 {
54  set(bounding_layer_document);
55 }
56 
57 
58 // COPY CONSTRUCTOR
59 
63 
64 BoundingLayer::BoundingLayer(const BoundingLayer& other_bounding_layer)
65 {
66  set(other_bounding_layer);
67 }
68 
69 
70 // DESTRUCTOR
71 
74 
76 {
77 }
78 
79 
80 // ASSIGNMENT OPERATOR
81 
85 
87 {
88  if(this != &other_bounding_layer)
89  {
90  lower_bounds = other_bounding_layer.lower_bounds;
91  upper_bounds = other_bounding_layer.upper_bounds;
92  display = other_bounding_layer.display;
93  }
94 
95  return(*this);
96 }
97 
98 
99 // EQUAL TO OPERATOR
100 
101 // bool operator == (const BoundingLayer&) const method
102 
107 
108 bool BoundingLayer::operator == (const BoundingLayer& other_bounding_layer) const
109 {
110  if(lower_bounds == other_bounding_layer.lower_bounds
111  && upper_bounds == other_bounding_layer.upper_bounds
112  && display == other_bounding_layer.display)
113  {
114  return(true);
115  }
116  else
117  {
118  return(false);
119  }
120 }
121 
122 
123 // bool is_empty(void) const method
124 
126 
127 bool BoundingLayer::is_empty(void) const
128 {
129  if(get_bounding_neurons_number() == 0)
130  {
131  return(true);
132  }
133  else
134  {
135  return(false);
136  }
137 }
138 
139 
140 // size_t get_bounding_neurons_number(void) const method
141 
143 
145 {
146  return(lower_bounds.size());
147 }
148 
149 
150 // const Vector<double>& get_lower_bounds(void) const method
151 
153 
155 {
156  return(lower_bounds);
157 }
158 
159 
160 // double get_lower_bound(const size_t&) const const method
161 
164 
165 double BoundingLayer::get_lower_bound(const size_t& i) const
166 {
167  // Control sentence (if debug)
168 
169  #ifndef NDEBUG
170 
171  const size_t bounding_neurons_number = get_bounding_neurons_number();
172 
173  if(i >= bounding_neurons_number)
174  {
175  std::ostringstream buffer;
176 
177  buffer << "OpenNN Exception: BoundingLayer class.\n"
178  << "double get_lower_bound(const size_t&) const method.\n"
179  << "Index must be less than number of bounding neurons.\n";
180 
181  throw std::logic_error(buffer.str());
182  }
183 
184  #endif
185 
186  return(lower_bounds[i]);
187 }
188 
189 
190 // const Vector<double>& get_upper_bound(void) const method
191 
193 
195 {
196  return(upper_bounds);
197 }
198 
199 
200 // double get_upper_bound(const size_t&) const method
201 
204 
205 double BoundingLayer::get_upper_bound(const size_t& i) const
206 {
207  // Control sentence (if debug)
208 
209  #ifndef NDEBUG
210 
211  const size_t bounding_neurons_number = get_bounding_neurons_number();
212 
213  if(bounding_neurons_number == 0)
214  {
215  std::ostringstream buffer;
216 
217  buffer << "OpenNN Exception: BoundingLayer class.\n"
218  << "double get_upper_bound(const size_t&) const method.\n"
219  << "Number of bounding neurons is zero.\n";
220 
221  throw std::logic_error(buffer.str());
222  }
223  else if(i >= bounding_neurons_number)
224  {
225  std::ostringstream buffer;
226 
227  buffer << "OpenNN Exception: BoundingLayer class.\n"
228  << "double get_upper_bound(const size_t&) const method.\n"
229  << "Index must be less than number of bounding neurons.\n";
230 
231  throw std::logic_error(buffer.str());
232  }
233 
234  #endif
235 
236  return(upper_bounds[i]);
237 }
238 
239 
240 // Vector< Vector<double>* > get_bounds(void) method
241 
246 
248 {
249  Vector< Vector<double>* > bounds(2);
250 
251  bounds[0] = &lower_bounds;
252  bounds[1] = &upper_bounds;
253 
254  return(bounds);
255 }
256 
257 
258 // void set(void)
259 
262 
264 {
265  lower_bounds.set();
266  upper_bounds.set();
267 
268  set_default();
269 }
270 
271 
272 // void set(const size_t&)
273 
277 
278 void BoundingLayer::set(const size_t& new_bounding_neurons_number)
279 {
280  lower_bounds.set(new_bounding_neurons_number);
281  upper_bounds.set(new_bounding_neurons_number);
282 
283  set_default();
284 }
285 
286 
287 // void set(const tinyxml2::XMLDocument&) method
288 
291 
292 void BoundingLayer::set(const tinyxml2::XMLDocument& bounding_layer_document)
293 {
294  set_default();
295 
296  from_XML(bounding_layer_document);
297 }
298 
299 
300 // void set(const BoundingLayer&)
301 
304 
305 void BoundingLayer::set(const BoundingLayer& other_bounding_layer)
306 {
307  lower_bounds = other_bounding_layer.lower_bounds;
308 
309  upper_bounds = other_bounding_layer.upper_bounds;
310 
311  display = other_bounding_layer.display;
312 }
313 
314 
315 // void set_lower_bound(const Vector<double>&) method
316 
319 
320 void BoundingLayer::set_lower_bounds(const Vector<double>& new_lower_bounds)
321 {
322  // Control sentence (if debug)
323 
324  #ifndef NDEBUG
325 
326  const size_t bounding_neurons_number = get_bounding_neurons_number();
327 
328  if(new_lower_bounds.size() != bounding_neurons_number)
329  {
330  std::ostringstream buffer;
331 
332  buffer << "OpenNN Exception: BoundingLayer class.\n"
333  << "void set_lower_bounds(const Vector<double>&) method.\n"
334  << "Size must be equal to number of bounding neurons number.\n";
335 
336  throw std::logic_error(buffer.str());
337  }
338 
339  #endif
340 
341  // Set lower bound of bounding neurons
342 
343  lower_bounds = new_lower_bounds;
344 }
345 
346 
347 // void set_lower_bound(const size_t&, const double&) method
348 
353 
354 void BoundingLayer::set_lower_bound(const size_t& index, const double& new_lower_bound)
355 {
356  const size_t bounding_neurons_number = get_bounding_neurons_number();
357 
358  // Control sentence (if debug)
359 
360  #ifndef NDEBUG
361 
362  if(index >= bounding_neurons_number)
363  {
364  std::ostringstream buffer;
365 
366  buffer << "OpenNN Exception: BoundingLayer class.\n"
367  << "void set_lower_bound(const size_t&, const double&) method.\n"
368  << "Index of bounding neurons must be less than number of bounding neurons.\n";
369 
370  throw std::logic_error(buffer.str());
371  }
372 
373  #endif
374 
375  if(lower_bounds.size() != bounding_neurons_number)
376  {
377  lower_bounds.set(bounding_neurons_number, -1.0e99);
378  }
379 
380  // Set lower bound of single neuron
381 
382  lower_bounds[index] = new_lower_bound;
383 }
384 
385 
386 // void set_upper_bounds(const Vector<double>&) method
387 
391 
392 void BoundingLayer::set_upper_bounds(const Vector<double>& new_upper_bounds)
393 {
394  // Control sentence (if debug)
395 
396  #ifndef NDEBUG
397 
398  const size_t bounding_neurons_number = get_bounding_neurons_number();
399 
400  if(new_upper_bounds.size() != bounding_neurons_number)
401  {
402  std::ostringstream buffer;
403 
404  buffer << "OpenNN Exception: BoundingLayer class.\n"
405  << "void set_upper_bound(const Vector<double>&) method.\n"
406  << "Size must be equal to number of bounding neurons.\n";
407 
408  throw std::logic_error(buffer.str());
409  }
410 
411  #endif
412 
413  // Set upper bound of neurons
414 
415  upper_bounds = new_upper_bounds;
416 }
417 
418 
419 // void set_upper_bound(const size_t&, const double&) method
420 
425 
426 void BoundingLayer::set_upper_bound(const size_t& index, const double& new_upper_bound)
427 {
428  const size_t bounding_neurons_number = get_bounding_neurons_number();
429 
430  // Control sentence (if debug)
431 
432  #ifndef NDEBUG
433 
434  if(index >= bounding_neurons_number)
435  {
436  std::ostringstream buffer;
437 
438  buffer << "OpenNN Exception: BoundingLayer class.\n"
439  << "void set_upper_bound(const size_t&, const double&) method.\n"
440  << "Index of bounding neuron must be less than number of bounding neurons.\n";
441 
442  throw std::logic_error(buffer.str());
443  }
444 
445  #endif
446 
447  if(upper_bounds.size() != bounding_neurons_number)
448  {
449  upper_bounds.set(bounding_neurons_number, 1.0e99);
450  }
451 
452  // Set upper bound of single bounding neuron
453 
454  upper_bounds[index] = new_upper_bound;
455 }
456 
457 
458 // void set_bounds(const Vector< Vector<double> >&) method
459 
466 
468 {
469  // Control sentence (if debug)
470 
471  #ifndef NDEBUG
472 
473  const size_t size = new_bounds.size();
474 
475  const size_t bounding_neurons_number = get_bounding_neurons_number();
476 
477  if(size != 2)
478  {
479  std::ostringstream buffer;
480 
481  buffer << "OpenNN Exception: BoundingLayer class.\n"
482  << "void set_bounds(const Vector< Vector<double> >&) method.\n"
483  << "Number of rows must be 2.\n";
484 
485  throw std::logic_error(buffer.str());
486  }
487  else if(new_bounds[0].size() != bounding_neurons_number
488  && new_bounds[1].size() != bounding_neurons_number)
489  {
490  std::ostringstream buffer;
491 
492  buffer << "OpenNN Exception: BoundingLayer class.\n"
493  << "void set_bounds(const Vector< Vector<double> >&) method.\n"
494  << "Number of columns must be equal to number of bounding neurons.\n";
495 
496  throw std::logic_error(buffer.str());
497  }
498 
499  #endif
500 
501  // Set lower and upper bounds of bounding neurons
502 
503  set_lower_bounds(new_bounds[0]);
504  set_upper_bounds(new_bounds[1]);
505 }
506 
507 
508 // void set_display(const bool&) method
509 
514 
515 void BoundingLayer::set_display(const bool& new_display)
516 {
517  display = new_display;
518 }
519 
520 
521 // void set_default(void) method
522 
527 
529 {
530  display = true;
531 }
532 
533 
534 // void prune_bounding_neuron(const size_t&) method
535 
538 
539 void BoundingLayer::prune_bounding_neuron(const size_t& index)
540 {
541  // Control sentence (if debug)
542 
543  #ifndef NDEBUG
544 
545  const size_t bounding_neurons_number = get_bounding_neurons_number();
546 
547  if(index >= bounding_neurons_number)
548  {
549  std::ostringstream buffer;
550 
551  buffer << "OpenNN Exception: BoundingLayer class.\n"
552  << "void prune_bounding_neuron(const size_t&) method.\n"
553  << "Index of bounding neuron is equal or greater than number of bounding neurons.\n";
554 
555  throw std::logic_error(buffer.str());
556  }
557 
558  #endif
559 
560  lower_bounds.erase(lower_bounds.begin() + index);
561  upper_bounds.erase(upper_bounds.begin() + index);
562 }
563 
564 
565 // void initialize_random(void) method
566 
568 
570 {
571  Vector<double> random_vector(4);
572  random_vector.randomize_normal();
573 
574  std::sort(random_vector.begin(), random_vector.end());
575 
576  lower_bounds.randomize_uniform(random_vector[0], random_vector[1]);
577  upper_bounds.randomize_uniform(random_vector[2], random_vector[3]);
578 }
579 
580 
581 // Vector<double> calculate_outputs(const Vector<double>&) const method
582 
585 
587 {
588  // Control sentence (if debug)
589 
590  #ifndef NDEBUG
591 
592  const size_t inputs_size = inputs.size();
593 
594  const size_t bounding_neurons_number = get_bounding_neurons_number();
595 
596  if(inputs_size != bounding_neurons_number)
597  {
598  std::ostringstream buffer;
599 
600  buffer << "OpenNN Exception: BoundingLayer class.\n"
601  << "Vector<double> calculate_outputs(const Vector<double>&) const method.\n"
602  << "Size of inputs must be equal to number of bounding neurons.\n";
603 
604  throw std::logic_error(buffer.str());
605  }
606 
607  #endif
608 
610 }
611 
612 
613 // Vector<double> calculate_derivative(const Vector<double>&) const method
614 
617 
619 {
620  const size_t bounding_neurons_number = get_bounding_neurons_number();
621 
622  const Vector<double> outputs = calculate_outputs(inputs);
623 
624  Vector<double> derivatives(bounding_neurons_number);
625 
626  for(size_t i = 0; i < bounding_neurons_number; i++)
627  {
628  if(outputs[i] <= lower_bounds[i] || outputs[i] >= upper_bounds[i])
629  {
630  derivatives[i] = 0.0;
631  }
632  else
633  {
634  derivatives[i] = 1.0;
635  }
636  }
637 
638  return(derivatives);
639 }
640 
641 
642 // Vector<double> calculate_second_derivative(const Vector<double>&) const method
643 
646 
648 {
649  std::ostringstream buffer;
650 
651  const size_t bounding_neurons_number = get_bounding_neurons_number();
652 
653  const Vector<double> outputs = calculate_outputs(inputs);
654 
655  for(size_t i = 0; i < bounding_neurons_number; i++)
656  {
657  if(outputs[i] == lower_bounds[i])
658  {
659  buffer << "OpenNN Exception: BoundingLayer class.\n"
660  << "Vector<double> calculate_outputs(const Vector<double>&) const method.\n"
661  << "Output is equal to lower bound. The bounding function is not differentiable at this point.\n";
662 
663  throw std::logic_error(buffer.str());
664  }
665  else if(outputs[i] == upper_bounds[i])
666  {
667  buffer << "OpenNN Exception: BoundingLayer class.\n"
668  << "Vector<double> calculate_outputs(const Vector<double>&) const method.\n"
669  << "Output is equal to upper bound. The bounding function is not differentiable at this point.\n";
670 
671  throw std::logic_error(buffer.str());
672  }
673  }
674 
675  Vector<double> second_derivative(bounding_neurons_number, 0.0);
676 
677  return(second_derivative);
678 }
679 
680 
681 // Matrix<double> arrange_Jacobian(const Vector<double>&) const method
682 
686 
688 {
689  const size_t bounding_neurons_number = get_bounding_neurons_number();
690 
691  // Control sentence (if debug)
692 
693  #ifndef NDEBUG
694 
695  const size_t derivatives_size = derivatives.size();
696 
697  if(derivatives_size != bounding_neurons_number)
698  {
699  std::ostringstream buffer;
700 
701  buffer << "OpenNN Exception: BoundingLayer class.\n"
702  << "Matrix<double> arrange_Jacobian(const Vector<double>&) method.\n"
703  << "Size of derivatives must be equal to number of bounding neurons.\n";
704 
705  throw std::logic_error(buffer.str());
706  }
707 
708  #endif
709 
710  Matrix<double> Jacobian(bounding_neurons_number, bounding_neurons_number, 0.0);
711  Jacobian.set_diagonal(derivatives);
712 
713  return(Jacobian);
714 }
715 
716 
717 // Vector< Matrix<double> > arrange_Hessian_form(const Vector<double>&) const method
718 
721 
723 {
724  const size_t bounding_neurons_number = get_bounding_neurons_number();
725 
726  Vector< Matrix<double> > bounded_Hessian_form(bounding_neurons_number);
727 
728  for(size_t i = 0; i < bounding_neurons_number; i++)
729  {
730  bounded_Hessian_form[i].set(bounding_neurons_number, bounding_neurons_number, 0.0);
731  }
732 
733  return(bounded_Hessian_form);
734 }
735 
736 
737 // std::string write_expression(const Vector<std::string>&, const Vector<std::string>&) const method
738 
740 
741 std::string BoundingLayer::write_expression(const Vector<std::string>& inputs_name, const Vector<std::string>& outputs_name) const
742 {
743  std::stringstream expression;
744 
745  const size_t bounding_neurons_number = get_bounding_neurons_number();
746 
747  for(size_t i = 0; i < bounding_neurons_number; i++)
748  {
749  expression << outputs_name[i] << " < " << lower_bounds[i] << " ? " << lower_bounds[i] << " : " << inputs_name[i] << "\n";
750  expression << outputs_name[i] << " > " << upper_bounds[i] << " ? " << upper_bounds[i] << " : " << inputs_name[i] << "\n";
751  }
752 
753  return(expression.str());
754 }
755 
756 
757 // std::string to_string(void) const method
758 
760 
761 std::string BoundingLayer::to_string(void) const
762 {
763  std::ostringstream buffer;
764 
765  buffer << "Bounding layer\n"
766  << "Lower bounds: " << lower_bounds << "\n"
767  << "Upper bounds: " << upper_bounds << "\n"
768  << "Display: " << display << "\n";
769 
770  return(buffer.str());
771 }
772 
773 
774 // tinyxml2::XMLDocument* to_XML(void) const method
775 
778 
779 tinyxml2::XMLDocument* BoundingLayer::to_XML(void) const
780 {
781  tinyxml2::XMLDocument* document = new tinyxml2::XMLDocument;
782 
783  std::ostringstream buffer;
784 
785  tinyxml2::XMLElement* bounding_layer_element = document->NewElement("BoundingLayer");
786 
787  document->InsertFirstChild(bounding_layer_element);
788 
789  // Lower bounds
790 
791  {
792  tinyxml2::XMLElement* element = document->NewElement("LowerBounds");
793  bounding_layer_element->LinkEndChild(element);
794 
795  buffer.str("");
796  buffer << lower_bounds;
797 
798  tinyxml2::XMLText* text = document->NewText(buffer.str().c_str());
799  element->LinkEndChild(text);
800  }
801 
802  // Upper bounds
803 
804  {
805  tinyxml2::XMLElement* element = document->NewElement("UpperBounds");
806  bounding_layer_element->LinkEndChild(element);
807 
808  buffer.str("");
809  buffer << upper_bounds;
810 
811  tinyxml2::XMLText* text = document->NewText(buffer.str().c_str());
812  element->LinkEndChild(text);
813  }
814 
815  // Display
816  {
817  tinyxml2::XMLElement* display_element = document->NewElement("Display");
818  bounding_layer_element->LinkEndChild(display_element);
819 
820  buffer.str("");
821  buffer << display;
822 
823  tinyxml2::XMLText* display_text = document->NewText(buffer.str().c_str());
824  display_element->LinkEndChild(display_text);
825  }
826 
827  return(document);
828 }
829 
830 
831 // void from_XML(const tinyxml2::XMLDocument&) method
832 
835 
836 void BoundingLayer::from_XML(const tinyxml2::XMLDocument& document)
837 {
838  // Control sentence
839 // {
840 // const char* text = bounding_layer_element->GetText();
841 
842 // const std::string string(text);
843 
844 // if(string != "BoundingLayer")
845 // {
846 // std::ostringstream buffer;
847 
848 // buffer << "OpenNN Exception: BoundingLayer class.\n"
849 // << "void from_XML(const tinyxml2::XMLDocument&) method.\n"
850 // << "Unkown root element: " << text << ".\n";
851 
852 // throw std::logic_error(buffer.str());
853 // }
854 // }
855 
856  // Lower bounds
857  {
858  const tinyxml2::XMLElement* lower_bounds_element = document.FirstChildElement("LowerBounds");
859 
860  if(lower_bounds_element)
861  {
862  const char* lower_bounds_text = lower_bounds_element->GetText();
863 
864  if(lower_bounds_text)
865  {
866  Vector<double> new_lower_bounds;
867  new_lower_bounds.parse(lower_bounds_text);
868 
869  try
870  {
871  set_lower_bounds(new_lower_bounds);
872  }
873  catch(const std::logic_error& e)
874  {
875  std::cout << e.what() << std::endl;
876  }
877  }
878  }
879  }
880 
881  // Upper bounds
882  {
883  const tinyxml2::XMLElement* upper_bounds_element = document.FirstChildElement("UpperBounds");
884 
885  if(upper_bounds_element)
886  {
887  const char* upper_bounds_text = upper_bounds_element->GetText();
888 
889  if(upper_bounds_text)
890  {
891  Vector<double> new_upper_bounds;
892  new_upper_bounds.parse(upper_bounds_text);
893 
894  try
895  {
896  set_upper_bounds(new_upper_bounds);
897  }
898  catch(const std::logic_error& e)
899  {
900  std::cout << e.what() << std::endl;
901  }
902  }
903  }
904  }
905 
906  // Display
907  {
908  const tinyxml2::XMLElement* display_element = document.FirstChildElement("Display");
909 
910  if(display_element)
911  {
912  std::string new_display_string = display_element->GetText();
913 
914  try
915  {
916  set_display(new_display_string != "0");
917  }
918  catch(const std::logic_error& e)
919  {
920  std::cout << e.what() << std::endl;
921  }
922  }
923  }
924 }
925 
926 }
927 
928 // OpenNN: Open Neural Networks Library.
929 // Copyright (c) 2005-2015 Roberto Lopez.
930 //
931 // This library is free software; you can redistribute it and/or
932 // modify it under the terms of the GNU Lesser General Public
933 // License as published by the Free Software Foundation; either
934 // version 2.1 of the License, or any later version.
935 //
936 // This library is distributed in the hope that it will be useful,
937 // but WITHOUT ANY WARRANTY; without even the implied warranty of
938 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
939 // Lesser General Public License for more details.
940 
941 // You should have received a copy of the GNU Lesser General Public
942 // License along with this library; if not, write to the Free Software
943 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
void parse(const std::string &)
Definition: vector.h:5217
std::string to_string(void) const
Returns a string representation of the current bonding layer object.
Vector< Matrix< double > > arrange_Hessian_form(const Vector< double > &) const
tinyxml2::XMLDocument * to_XML(void) const
void randomize_uniform(const double &=-1.0, const double &=1.0)
Definition: vector.h:781
void set_display(const bool &)
Vector< double > calculate_derivative(const Vector< double > &) const
const Vector< double > & get_upper_bounds(void) const
Returns the upper bounds values of all the bounding neurons in the layer.
Matrix< double > arrange_Jacobian(const Vector< double > &) const
bool display
Display messages to screen.
void set(void)
Sets the size of a vector to zero.
Definition: vector.h:656
void from_XML(const tinyxml2::XMLDocument &)
bool is_empty(void) const
Returns true if the size of the layer is zero, and false otherwise.
bool operator==(const BoundingLayer &) const
size_t get_bounding_neurons_number(void) const
Returns the number of bounding neurons in the layer.
std::string write_expression(const Vector< std::string > &, const Vector< std::string > &) const
Returns a string with the expression of the lower and upper bounds functions.
void set_diagonal(const T &)
Definition: matrix.h:1858
void set_lower_bounds(const Vector< double > &)
Vector< T > calculate_lower_upper_bounded(const T &, const T &) const
Definition: vector.h:3106
void set_bounds(const Vector< Vector< double > > &)
Vector< double > calculate_outputs(const Vector< double > &) const
void set_upper_bounds(const Vector< double > &)
void randomize_normal(const double &=0.0, const double &=1.0)
Definition: vector.h:867
double get_lower_bound(const size_t &) const
Vector< double > lower_bounds
Lower bounds of output variables.
Vector< double > calculate_second_derivative(const Vector< double > &) const
Vector< Vector< double > * > get_bounds(void)
void initialize_random(void)
Initializes the lower and upper bounds of all the bounding neurons with random values.
void set_lower_bound(const size_t &, const double &)
Vector< double > upper_bounds
Upper bounds of output variables.
virtual ~BoundingLayer(void)
void prune_bounding_neuron(const size_t &)
const Vector< double > & get_lower_bounds(void) const
Returns the lower bounds values of all the bounding neurons in the layer.
double get_upper_bound(const size_t &) const
void set_upper_bound(const size_t &, const double &)
BoundingLayer & operator=(const BoundingLayer &)