示例#1
0
    def showStructure(self, fenetre, idConf):

        # Get config
        config = db.getConfig(self.conn, idConf)

        dialogShowStructure = view.TextModalWindow(fenetre, None)
        dialogShowStructure.run(config["structure"], True)
示例#2
0
    def updateConfig(self, fenetre, idConf):
        "Update new config"

        # Get config
        config = db.getConfig(self.conn, idConf)

        viewConfig = view.CreateOrUpdateConfigWindow(fenetre,
                                                     self.doUpdateConfig)

        #Get machine names
        machineNames = db.getMachineNames(self.conn)

        # Add machine name
        idMachine = config["idMachine"]
        machineName = db.getMachineNameById(self.conn, idMachine)
        config["machine"] = machineName

        # launch view with callback
        viewConfig.run(machineNames, config)
示例#3
0
    def start(self, fenetre, idDataset, idConfig):
        # Get form fields for machine
        config = db.getConfig(self.conn, idConfig)

        # Get machine name
        machineName = db.getMachineNameById(self.conn, config["idMachine"])
        # Get fields
        machineFields = self.confMachinesForms[machineName]

        # Get default values
        selectionKey = "dataset=" + str(idDataset) + ";config=" + str(idConfig)
        machineFieldValues = db.getSelection(self.conn, selectionKey)

        # Launch run dialog
        startTrainingDialog = view.StartTrainDialog(fenetre, self.conn,
                                                    selectionKey,
                                                    fenetre.doRunTraining,
                                                    machineFields,
                                                    machineFieldValues)
        startTrainingDialog.run()
示例#4
0
    def updateHyperParams(self, fenetre, idConf):

        # get idDataset
        nameDataset = fenetre.varDataset.get()
        idDataset = db.getDatasetIdByName(self.conn, nameDataset)

        # Get config
        self.config = db.getConfig(self.conn, idConf)

        # get hyper parameters
        hyperParams = db.getHyperParams(self.conn, idDataset, idConf)

        # get best hyper params
        (bestHyperParams, bestDevAccuracy,
         _) = db.getBestHyperParams(self.conn, idDataset, idConf)

        # Launch window, it may update hps
        viewHp = view.ViewOrUpdateHyperParamsWindow(
            fenetre, self.doCreateOrUpdateHyperParams)

        # launch view with callback
        viewHp.run(hyperParams, bestHyperParams, bestDevAccuracy)
示例#5
0
                { "comment": "", "tune": False, "showPlots": False, "nbTuning": 2, "isTensorboard": debugIsTensorBord, "isTensorboardFull": False },
                { "choiceHyperParams" : 1, "choiceData" : 1 }
            )

        # cancel?
        if ( buttonClicked == "Cancel" ) :
            logger.info( "Operation cancelled by user" )
            sys.exit( 10 )

        # dataset
        idDataset = db.getDatasetIdByName( conn, datasetName )
        dataset = db.getDatasetById( conn, idDataset )
        logger.info( "Using dataset {0}".format( dataset ) )

        # Read config
        config = db.getConfig( conn, idConfig );
        # get machine name
        machineName = db.getMachineNameById( conn, config[ "idMachine" ] )

        logger.info( "Structure:" )
        logger.info( config[ "structure" ] )

        # get hyper parameters
        if ( buttonClicked == "Train" ) :

            # Get config hyper parameters
            hyperParams = db.getHyperParams( conn, idDataset, config[ "id" ] )

        elif ( buttonClicked == "Predict" ) :

            # hyper parameters depend on choice