7a64a6de40303b7febb4ec02cb925dc948117160,deepplantphenomics/deepplantpheno.py,DPPModel,beginTraining,#DPPModel#,207

Before Change


        if self.__tb_dir is not None:
            // Summaries for any problem type
            tf.summary.scalar("train/loss", cost)
            tf.summary.scalar("train/learning_rate", self.__learning_rate)
            tf.summary.scalar("train/l2_loss", tf.reduce_mean(l2_cost))
            filter_summary = self.__getWeightsAsImage(self.__firstLayer().weights)
            tf.summary.image("filters/first", filter_summary)

            // Summaries for classification problems
            if self.__problem_type == definitions.ProblemType.CLASSIFICATION:
                tf.summary.scalar("train/accuracy", accuracy)
                tf.summary.scalar("test/accuracy", test_accuracy)
                tf.summary.histogram("train/class_predictions", class_predictions)
                tf.summary.histogram("test/class_predictions", test_class_predictions)

            // Summaries for regression
            if self.__problem_type == definitions.ProblemType.REGRESSION:
                tf.summary.scalar("test/loss", test_cost)

            // Summaries for each layer
            for layer in self.__layers:
                if hasattr(layer, "name"):
                    tf.summary.histogram("weights/"+layer.name, layer.weights)
                    tf.summary.histogram("biases/"+layer.name, layer.biases)
                    tf.summary.histogram("activations/"+layer.name, layer.activations)

            merged = tf.summary.merge_all()
            train_writer = tf.summary.FileWriter(self.__tb_dir, self.__session.graph)

        // Either load the network parameters from a checkpoint file or start training
        if self.__load_from_saved is not False:
            self.__log("Loading from checkpoint file...")
            saver = tf.train.Saver()
            saver.restore(self.__session, tf.train.latest_checkpoint(self.__load_from_saved))

            self.__initializeQueueRunners()

After Change


            for layer in self.__layers:
                if hasattr(layer, "name"):
                    tf.summary.histogram("weights/"+layer.name, layer.weights, collections=["custom_summaries"])
                    tf.summary.histogram("biases/"+layer.name, layer.biases, collections=["custom_summaries"])
                    tf.summary.histogram("activations/"+layer.name, layer.activations, collections=["custom_summaries"])

            merged = tf.summary.merge_all(key="custom_summaries")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: p2irc/deepplantphenomics
Commit Name: 7a64a6de40303b7febb4ec02cb925dc948117160
Time: 2017-01-31
Author: jubbens@gmail.com
File Name: deepplantphenomics/deepplantpheno.py
Class Name: DPPModel
Method Name: beginTraining


Project Name: p2irc/deepplantphenomics
Commit Name: 7a64a6de40303b7febb4ec02cb925dc948117160
Time: 2017-01-31
Author: jubbens@gmail.com
File Name: deepplantphenomics/deepplantpheno.py
Class Name: DPPModel
Method Name: beginTraining


Project Name: tensorflow/magenta
Commit Name: 982740ee6e56d674e3f220d7bf215ae4132c9c1c
Time: 2019-02-22
Author: fjord@google.com
File Name: magenta/models/onsets_frames_transcription/onsets_frames_transcription_infer.py
Class Name:
Method Name: main


Project Name: yahoo/TensorFlowOnSpark
Commit Name: 740a50efc55d175bd95e605d7fc1e037ca640b9b
Time: 2019-07-25
Author: leewyang@verizonmedia.com
File Name: tensorflowonspark/pipeline.py
Class Name:
Method Name: _run_model