class_docstr: A class for checking if a neural network satisfies constraints. 
docstr: Checks if the neural network nn satisfies the constraints. If return_violation
  is True, it returns a string representing the violation. 
docstr_tok: ["Checks","if","the","neural","network","nn","satisfies","the","constraints",".","If","return_violation","is","True",",","it","returns","a","string","representing","the","violation","."]
code: def constraints_are_satisfied(self, nn, return_violation=False):
      """Checks if the neural network nn satisfies the constraints. If return_violation
      is True, it returns a string representing the violation."""
      violation = ""
      if not self._check_leq_constraint(
          len(nn.layer_labels), self.max_num_layers
      ):
          violation = "too_many_layers"
      elif not self._check_geq_constraint(
          len(nn.layer_labels), self.min_num_layers
      ):
          violation = "too_few_layers"
      elif not self._check_leq_constraint(
          nn.get_total_mass(), self.max_mass
      ):
          violation = "too_much_mass"
      elif not self._check_geq_constraint(
          nn.get_total_mass(), self.min_mass
      ):
          violation = "too_little_mass"
      elif not self._check_leq_constraint(
          nn.get_out_degrees().max(), self.max_out_degree
      ):
          violation = "large_max_out_degree"
      elif not self._check_leq_constraint(
          nn.get_in_degrees().max(), self.max_in_degree
      ):
          violation = "large_max_in_degree"
      elif not self._check_leq_constraint(
          nn.conn_mat.sum(), self.max_num_edges
      ):
          violation = "too_many_edges"
      elif not self._check_leq_constraint(
          self._finite_max_or_min(nn.num_units_in_each_layer, 1),
          self.max_num_units_per_layer,
      ):
          violation = "max_units_per_layer_exceeded"
      elif not self._check_geq_constraint(
          self._finite_max_or_min(nn.num_units_in_each_layer, 0),
          self.min_num_units_per_layer,
      ):
          violation = "min_units_per_layer_not_exceeded"
      else:
          violation = self._child_constraints_are_satisfied(nn)
      return violation if return_violation else (violation == "")
  
imports: import numpy
  from copy import copy
  from ..exd.domains import Domain
label_desc: Use image node_id 3 for calling the NNConstraintChecker obj's underlying member method code with example usage: obj.constraints_are_satisfied(nn, return_violation) and returns: unknown