class_docstr: Deep Neural Network Model.
  
  TODO: complete description
  
  Arguments:
      network: `Tensor`. Neural network to be used.
      tensorboard_verbose: `int`. Summary verbose level, it accepts
          different levels of tensorboard logs:
          ```python
          0: Loss, Accuracy (Best Speed).
          1: Loss, Accuracy, Gradients.
          2: Loss, Accuracy, Gradients, Weights.
          3: Loss, Accuracy, Gradients, Weights, Activations, Sparsity.
              (Best visualization)
          ```
      tensorboard_dir: `str`. Directory to store tensorboard logs.
          Default: "/tmp/tflearn_logs/"
      checkpoint_path: `str`. Path to store model checkpoints. If None,
          no model checkpoint will be saved. Default: None.
      best_checkpoint_path: `str`. Path to store the model when the validation rate reaches its
          highest point of the current training session and also is above best_val_accuracy. Default: None.
      max_checkpoints: `int` or None. Maximum amount of checkpoints. If
          None, no limit. Default: None.
      session: `Session`. A session for running ops. If None, a new one will
          be created. Note: When providing a session, variables must have been
          initialized already, otherwise an error will be raised.
      best_val_accuracy: `float` The minimum validation accuracy that needs to be
          achieved before a model weight's are saved to the best_checkpoint_path. This
          allows the user to skip early saves and also set a minimum save point when continuing
          to train a reloaded model. Default: 0.0.
  
  Attributes:
      trainer: `Trainer`. Handle model training.
      predictor: `Predictor`. Handle model prediction.
      session: `Session`. The current model session.
class_docstr_tok: ["Deep","Neural","Network","Model",".","TODO",":","complete","description","Arguments",":","network",":","`","Tensor","`",".","Neural","network","to","be","used",".","tensorboard_verbose",":","`","int","`",".","Summary","verbose","level",",","it","accepts","different","levels","of","tensorboard","logs",":","``","`","python","0",":","Loss",",","Accuracy","(","Best","Speed",")",".","1",":","Loss",",","Accuracy",",","Gradients",".","2",":","Loss",",","Accuracy",",","Gradients",",","Weights",".","3",":","Loss",",","Accuracy",",","Gradients",",","Weights",",","Activations",",","Sparsity",".","(","Best","visualization",")","``","`","tensorboard_dir",":","`","str","`",".","Directory","to","store","tensorboard","logs",".","Default",":","``","\/tmp\/tflearn_logs\/","''","checkpoint_path",":","`","str","`",".","Path","to","store","model","checkpoints",".","If","None",",","no","model","checkpoint","will","be","saved",".","Default",":","None",".","best_checkpoint_path",":","`","str","`",".","Path","to","store","the","model","when","the","validation","rate","reaches","its","highest","point","of","the","current","training","session","and","also","is","above","best_val_accuracy",".","Default",":","None",".","max_checkpoints",":","`","int","`","or","None",".","Maximum","amount","of","checkpoints",".","If","None",",","no","limit",".","Default",":","None",".","session",":","`","Session","`",".","A","session","for","running","ops",".","If","None",",","a","new","one","will","be","created",".","Note",":","When","providing","a","session",",","variables","must","have","been","initialized","already",",","otherwise","an","error","will","be","raised",".","best_val_accuracy",":","`","float","`","The","minimum","validation","accuracy","that","needs","to","be","achieved","before","a","model","weight","'s","are","saved","to","the","best_checkpoint_path",".","This","allows","the","user","to","skip","early","saves","and","also","set","a","minimum","save","point","when","continuing","to","train","a","reloaded","model",".","Default",":","0.0",".","Attributes",":","trainer",":","`","Trainer","`",".","Handle","model","training",".","predictor",":","`","Predictor","`",".","Handle","model","prediction",".","session",":","`","Session","`",".","The","current","model","session","."]
code: def __init__(
      self,
      network,
      clip_gradients=5.0,
      tensorboard_verbose=0,
      tensorboard_dir="/tmp/tflearn_logs/",
      checkpoint_path=None,
      best_checkpoint_path=None,
      max_checkpoints=None,
      session=None,
      best_val_accuracy=0.0,
  ):
      assert isinstance(
          network, tf.Tensor
      ), "'network' arg is not a Tensor!"
      self.net = network
      self.train_ops = tf.get_collection(tf.GraphKeys.TRAIN_OPS)
      self.trainer = Trainer(
          self.train_ops,
          clip_gradients=clip_gradients,
          tensorboard_dir=tensorboard_dir,
          tensorboard_verbose=tensorboard_verbose,
          checkpoint_path=checkpoint_path,
          best_checkpoint_path=best_checkpoint_path,
          max_checkpoints=max_checkpoints,
          session=session,
          best_val_accuracy=best_val_accuracy,
      )
      self.session = self.trainer.session
  
      self.inputs = tf.get_collection(tf.GraphKeys.INPUTS)
      if len(self.inputs) == 0:
          raise Exception(
              "No input data! Please add an 'input_data' layer "
              "to your model (or add your input data "
              "placeholder to tf.GraphKeys.INPUTS collection)."
          )
      # verif_inputs = get_tensor_parents_placeholders(network)
      # if len(self.inputs) != len(verif_inputs):
      #     print("WARNING: TFLearn detected " + str(len(verif_inputs)) +
      #           " input placeholders, but tf collection '" +
      #           tf.GraphKeys.INPUTS + "' only contains " +
      #           str(len(self.inputs)) + ". If you define placeholders "
      #           "outside of TFLearn wrappers, make sure to add them to "
      #           "that collection.")
  
      self.targets = tf.get_collection(tf.GraphKeys.TARGETS)
      # TODO: error tracking when targets are actually used
      # if len(self.targets) == 0:
      #     raise Exception("No target data! Please add a 'regression' layer "
      #                     "to your model (or add your target data "
      #                     "placeholder to tf.GraphKeys.TARGETS collection).")
      self.predictor = Evaluator([self.net], session=self.session)
  
file_path: tflearn/tflearn/models/dnn.py
imports: from __future__ import division, print_function, absolute_import
  import tensorflow.compat.v1
  import numpy
  from ..helpers.trainer import Trainer
  from ..helpers.evaluator import Evaluator
  from ..utils import feed_dict_builder, is_none, get_tensor_parents_placeholders
label_desc: Use image node_id 1 to create a new DNN object from inherited base classes: object with example: obj = DNN(network, clip_gradients, tensorboard_verbose, tensorboard_dir, checkpoint_path, best_checkpoint_path, max_checkpoints, session, best_val_accuracy)