@@ -0,0 +1,1814 @@
+import json%0Aimport os%0Afrom builder.network_builder import Network%0A%0Aclass Generator:%0A%0A    def __init__(self):%0A        self.best_accuracy = 0%0A        self.best_accuracy_logdir = None%0A        self.best_network_spec = None%0A%0A    def get_best_spec (self, logdir):%0A        # get all netswork.json%0A        for subdir, dirs, files in os.walk(str(logdir)):%0A            for file in files:%0A                # filter%0A                if file == 'network.json':%0A                    file_loc = os.path.join(subdir, file)%0A                    #read current network.json%0A                    with open(file_loc, 'r') as fp:%0A                        n_spec = json.loads( fp.read() )%0A                        if('results' in n_spec ):%0A                            if(self.best_accuracy %3C n_spec%5B'results'%5D%5B'accuracy'%5D):%0A                                self.best_accuracy = n_spec%5B'results'%5D%5B'accuracy'%5D%0A                                self.best_accuracy_logdir = file_loc%0A                                self.best_network_spec = n_spec%0A%0A        #self._write_to_logdir(logdir=logdir, n_spec=self.best_network_spec)%0A        return self.best_network_spec%0A%0A    def _write_to_logdir(self, logdir, n_spec):%0A        file_loc = os.path.join(logdir, 'Best_Network.json')%0A        with open(file_loc, 'w') as fp:%0A            fp.write(str(n_spec))%0A%0A%0A%0A%0Adef main():%0A            base_logdir = 'log'%0A            output_logdir = base_logdir + '/best/'%0A%0A            generator = Generator()%0A            json_network_spec = generator.get_best_spec(logdir = base_logdir)%0A            print('best Network: ' + str(json_network_spec))%0A%0A            # workaround%0A            json_network_spec%5B'logdir'%5D = output_logdir%0A%0A            network = Network(json.dumps(json_network_spec))%0A            network.evaluate(get_weights=True)%0A%0A            print('Finished')%0A%0Amain()

include script to check for the best Network and generate the weights