Module ImportFrom alias alias alias Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias alias alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Num Str NameLoad NameLoad NameLoad body Assert Call NameLoad NameLoad AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr If CompareEq Call NameLoad AttributeLoad NameLoad attr Num body Raise Call NameLoad BinOpAdd BinOpAdd Str AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr If CompareEq Call NameLoad AttributeLoad NameLoad attr Num body Raise Call NameLoad Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr If CompareEq Call NameLoad AttributeLoad NameLoad attr Num body Raise Call NameLoad Str Assign AttributeStore NameLoad attr Call NameLoad ListLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Str If NameLoad body For NameStore AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad If NameLoad body If Call NameLoad NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad orelse If CompareNotIn Call NameLoad NameLoad ListLoad NameLoad NameLoad body Raise Call NameLoad BinOpAdd BinOpAdd Str Call NameLoad Call NameLoad NameLoad Str orelse Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore ListComp NameLoad comprehension NameStore AttributeLoad NameLoad attr Assign NameStore NameLoad If UnaryOpNot BoolOpOr Call NameLoad NameLoad Call NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore ListComp NameLoad comprehension NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call NameLoad ListLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr ImportFrom alias identifier Return Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list
N/A __future__ division print_function absolute_import N/A tensorflow tf helpers.trainer Trainer helpers.evaluator Evaluator utils feed_dict_builder is_none get_tensor_parents_placeholders DNN N/A object N/A N/A  Deep Neural Network Model.

    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.
        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.

    Attributes:
        trainer: `Trainer`. Handle model training.
        predictor: `Predictor`. Handle model prediction.
        session: `Session`. The current model session.

     __init__ N/A N/A self network clip_gradients tensorboard_verbose tensorboard_dir checkpoint_path max_checkpoints session N/A 5.0 0 /tmp/tflearn_logs/ None None None N/A N/A N/A isinstance network N/A tf Tensor 'network' arg is not a Tensor! N/A N/A self net network N/A N/A self train_ops N/A N/A tf get_collection N/A N/A tf GraphKeys TRAIN_OPS N/A N/A N/A len N/A self train_ops 0 N/A N/A N/A Exception N/A N/A tf collection " N/A N/A tf GraphKeys TRAIN_OPS " is empty! Please make sure you are using `regression` layer in your network. N/A N/A self trainer N/A Trainer N/A self train_ops clip_gradients clip_gradients tensorboard_dir tensorboard_dir tensorboard_verbose tensorboard_verbose checkpoint_path checkpoint_path max_checkpoints max_checkpoints session session N/A N/A self session N/A N/A self trainer session N/A N/A self inputs N/A N/A tf get_collection N/A N/A tf GraphKeys INPUTS N/A N/A N/A len N/A self inputs 0 N/A N/A N/A Exception No input data! Please add an 'input_data' layer to your model (or add your input data placeholder to tf.GraphKeys.INPUTS collection). N/A N/A self targets N/A N/A tf get_collection N/A N/A tf GraphKeys TARGETS N/A N/A N/A len N/A self inputs 0 N/A N/A N/A Exception No target data! Please add a 'regression' layer to your model (or add your target data placeholder to tf.GraphKeys.TARGETS collection). N/A N/A self predictor N/A Evaluator N/A N/A self net session N/A self session N/A fit N/A N/A self X_inputs Y_targets n_epoch validation_set show_metric batch_size shuffle snapshot_epoch snapshot_step run_id N/A 10 None False None None True None None N/A N/A  Fit.

        Train model, feeding X_inputs and Y_targets to the network.

        NOTE: When not feeding dicts, data assignations is made by
            input/estimator layers creation order (For example, the second
            input layer created will be feeded by the second value of
            X_inputs list).

        Examples:
            ```python
            model.fit(X, Y) # Single input and output
            model.fit({'input1': X}, {'output1': Y}) # Single input and output
            model.fit([X1, X2], Y) # Mutliple inputs, Single output

            # validate with X_val and [Y1_val, Y2_val]
            model.fit(X, [Y1, Y2], validation_set=(X_val, [Y1_val, Y2_val]))
            # 10% of training data used for validation
            model.fit(X, Y, validation_set=0.1)
            ```

        Arguments:
            X_inputs: array, `list` of array (if multiple inputs) or `dict`
                (with inputs layer name as keys). Data to feed to train
                model.
            Y_targets: array, `list` of array (if multiple inputs) or `dict`
                (with estimators layer name as keys). Targets (Labels) to
                feed to train model.
            n_epoch: `int`. Number of epoch to run. Default: None.
            validation_set: `tuple`. Represents data used for validation.
                `tuple` holds data and targets (provided as same type as
                X_inputs and Y_targets). Additionally, it also accepts
                `float` (<1) to performs a data split over training data.
            show_metric: `bool`. Display or not accuracy at every step.
            batch_size: `int` or None. If `int`, overrides all network
                estimators 'batch_size' by this value.
            shuffle: `bool` or None. If `bool`, overrides all network
                estimators 'shuffle' by this value.
            snapshot_epoch: `bool`. If True, it will snapshot model at the end
                of every epoch. (Snapshot a model will evaluate this model
                on validation set, as well as create a checkpoint if
                'checkpoint_path' specified).
            snapshot_step: `int` or None. If `int`, it will snapshot model
                every 'snapshot_step' steps.
            run_id: `str`. Give a name for this run. (Useful for Tensorboard).

         N/A batch_size N/A N/A train_op N/A self train_ops N/A N/A N/A train_op batch_size batch_size N/A N/A valX valY N/A None None N/A validation_set N/A N/A N/A isinstance validation_set float N/A N/A valX validation_set N/A valY validation_set N/A N/A N/A N/A type validation_set N/A tuple list N/A N/A N/A ValueError N/A N/A validation_set must be a tuple or list: (valX, valY),  N/A str N/A type validation_set  is not compatible! N/A N/A valX N/A validation_set N/A 0 N/A valY N/A validation_set N/A 1 N/A feed_dict N/A feed_dict_builder X_inputs Y_targets N/A self inputs N/A self targets N/A feed_dicts N/A feed_dict N/A i N/A self train_ops N/A val_feed_dicts None N/A N/A N/A N/A is_none valX N/A is_none valY N/A N/A val_feed_dict N/A feed_dict_builder valX valY N/A self inputs N/A self targets N/A val_feed_dicts N/A val_feed_dict N/A i N/A self train_ops N/A N/A N/A N/A self trainer fit feed_dicts val_feed_dicts val_feed_dicts n_epoch n_epoch show_metric show_metric snapshot_step snapshot_step snapshot_epoch snapshot_epoch shuffle_all shuffle run_id run_id N/A predict N/A N/A self X N/A N/A N/A  Predict.

        Model prediction for given input data.

        Arguments:
            X: array, `list` of array (if multiple inputs) or `dict`
                (with inputs layer name as keys). Data to feed for prediction.

        Returns:
            array or `list` of array. The predicted value.

         N/A feed_dict N/A feed_dict_builder X None N/A self inputs None N/A N/A N/A N/A self predictor predict feed_dict N/A save N/A N/A self model_file N/A N/A N/A  Save.

        Save model weights.

        Arguments:
            model_file: `str`. Model path.

         N/A N/A N/A N/A self trainer save model_file N/A load N/A N/A self model_file N/A N/A N/A  Load.

        Restore model weights.

        Arguments:
            model_file: `str`. Model path.

         N/A N/A N/A N/A self trainer restore model_file N/A N/A self session N/A N/A self trainer session N/A N/A self predictor N/A Evaluator N/A N/A self net session N/A self session model model_file N/A get_weights N/A N/A self weight_tensor N/A N/A N/A  Get Weights.

        Get a variable weights.

        Examples:
            ```
            dnn = DNNTrainer(...)
            w = dnn.get_weights(denselayer.W) # get a dense layer weights
            w = dnn.get_weights(convlayer.b) # get a conv layer biases
            ```

        Arguments:
            weight_tensor: `Tensor`. A Variable.

        Returns:
            `np.array`. The provided variable weights.
         N/A N/A N/A weight_tensor eval N/A N/A self trainer session N/A set_weights N/A N/A self tensor weights N/A N/A N/A  Set Weights.

        Assign a tensor variable a given value.

        Arguments:
            tensor: `Tensor`. The tensor variable to assign value.
            weights: The value to be assigned.

         N/A op N/A N/A tf assign tensor weights N/A N/A N/A N/A N/A self trainer session run op N/A evaluate N/A N/A self X Y batch_size N/A N/A N/A  Evaluate.

        Evaluate model on given samples.

        Arguments:
            X: array, `list` of array (if multiple inputs) or `dict`
                (with inputs layer name as keys). Data to feed to train
                model.
            Y: array, `list` of array (if multiple inputs) or `dict`
                (with estimators layer name as keys). Targets (Labels) to
                feed to train model. Usually set as the next element of a
                sequence, i.e. for x[0] => y[0] = x[1].
            batch_size: `int`. The batch size. Default: 128.

        Returns:
            The metric score.

         N/A feed_dict N/A feed_dict_builder X Y N/A self inputs N/A self targets tflearn.helpers.trainer evaluate ev N/A N/A ev N/A N/A self trainer session N/A self net feed_dict batch_size N/A N/A