docstr: Create a network definition object used to create the neural network
  formulation in Pyomo
  
  Args:
     scaling_object : ScalingInterface or None
        A scaling object to specify the scaling parameters for the
        neural network inputs and outputs. If None, then no
        scaling is performed.
     scaled_input_bounds : dict or None
        A dict that contains the bounds on the scaled variables (the
        direct inputs to the neural network). If None, then no bounds
        are specified or they are generated using unscaled bounds.
     unscaled_input_bounds: dict or None
        A dict that contains the bounds on the scaled variables (the
        direct inputs to the neural network). If supplied the scaled_input_bounds
        parameter will be generated using the scaling object.
        If None, then no bounds are specified.
docstr_tok: ["Create","a","network","definition","object","used","to","create","the","neural","network","formulation","in","Pyomo","Args",":","scaling_object",":","ScalingInterface","or","None","A","scaling","object","to","specify","the","scaling","parameters","for","the","neural","network","inputs","and","outputs",".","If","None",",","then","no","scaling","is","performed",".","scaled_input_bounds",":","dict","or","None","A","dict","that","contains","the","bounds","on","the","scaled","variables","(","the","direct","inputs","to","the","neural","network",")",".","If","None",",","then","no","bounds","are","specified","or","they","are","generated","using","unscaled","bounds",".","unscaled_input_bounds",":","dict","or","None","A","dict","that","contains","the","bounds","on","the","scaled","variables","(","the","direct","inputs","to","the","neural","network",")",".","If","supplied","the","scaled_input_bounds","parameter","will","be","generated","using","the","scaling","object",".","If","None",",","then","no","bounds","are","specified","."]
code: def __init__(
      self,
      scaling_object=None,
      scaled_input_bounds=None,
      unscaled_input_bounds=None,
  ):
      """
      Create a network definition object used to create the neural network
      formulation in Pyomo
  
      Args:
         scaling_object : ScalingInterface or None
            A scaling object to specify the scaling parameters for the
            neural network inputs and outputs. If None, then no
            scaling is performed.
         scaled_input_bounds : dict or None
            A dict that contains the bounds on the scaled variables (the
            direct inputs to the neural network). If None, then no bounds
            are specified or they are generated using unscaled bounds.
         unscaled_input_bounds: dict or None
            A dict that contains the bounds on the scaled variables (the
            direct inputs to the neural network). If supplied the scaled_input_bounds
            parameter will be generated using the scaling object.
            If None, then no bounds are specified.
      """
      self.__layers_by_id = dict()
      self.__graph = nx.DiGraph()
      self.__scaling_object = scaling_object
  
      # Process input bounds to insure scaled input bounds exist for formulations
      if scaled_input_bounds is None:
          if (
              unscaled_input_bounds is not None
              and scaling_object is not None
          ):
              lbs = scaling_object.get_scaled_input_expressions(
                  {k: t[0] for k, t in unscaled_input_bounds.items()}
              )
              ubs = scaling_object.get_scaled_input_expressions(
                  {k: t[1] for k, t in unscaled_input_bounds.items()}
              )
  
              scaled_input_bounds = {
                  k: (lbs[k], ubs[k])
                  for k in unscaled_input_bounds.keys()
              }
  
          # If unscaled input bounds provided and no scaler provided, scaled input bounds = unscaled input bounds
          elif (
              unscaled_input_bounds is not None
              and scaling_object is None
          ):
              scaled_input_bounds = unscaled_input_bounds
  
      self.__unscaled_input_bounds = unscaled_input_bounds
      self.__scaled_input_bounds = scaled_input_bounds
  
file_path: OMLT/src/omlt/neuralnet/network_definition.py
imports: import networkx
  from omlt.neuralnet.layer import Layer
label_desc: Use image node_id 1 to create a new NetworkDefinition object  with example: obj = NetworkDefinition(scaling_object, scaled_input_bounds, unscaled_input_bounds)