예제 #1
0
    def experimentdata(self):
        f = Frame(self.frame)
        self.experimentframe = f
        f.config(padx=20, pady=20, bg=Styles.colours["grey"])
        modeldetails = header(f, "Model:")
        fm = Frame(f)
        fm.config(padx=20, pady=20, bg=Styles.colours["grey"])
        infoh(fm, "Command:", self.params["command"].get(), 0, 0)
        infoh(fm, "Model Input:", self.params["modelinput"].get(), 1, 0)
        infoh(fm, "Model Output:", self.params["modeloutput"].get(), 2, 0)

        self.numexperitments = header(f, "Current Experiment: 0/0")
        _, self.iterinfo = infov(f, "Iteration:", "-", 5, 0)
        _, self.kernelinfo = infov(f, "Kernel:", "-", 5, 1)
        _, self.policyinfo = infov(f, "Policy:", "-", 5, 2)

        resultsframe = Frame(f)
        resultsframe.config(bg=Styles.colours["grey"])
        headersmall(resultsframe, "Best Result:       ").grid(row=0, column=0, sticky=W + E + N + S)

        Label(resultsframe, text="Current:", font=Styles.fonts["entry"], bg=Styles.colours["grey"], width=9).grid(row=0,
                                                                                                                  column=1,
                                                                                                                  sticky=E)
        self.curbestlabel = Label(resultsframe, bg=Styles.colours["grey"], text="-", width=20, font=Styles.fonts["h2"])
        self.curbestlabel.grid(row=0, column=2, sticky=W)

        Label(resultsframe, text="Overall:", font=Styles.fonts["entry"], bg=Styles.colours["grey"], width=9).grid(row=1,
                                                                                                                  column=1,
                                                                                                                  sticky=E)
        self.totbestlabel = Label(resultsframe, text=self.iniparams["totbest"], bg=Styles.colours["grey"], width=20,
                                  font=Styles.fonts["h2"])
        self.totbestlabel.grid(row=1, column=2, sticky=W)

        curresultsframe = Frame(f)
        curresultsframe.config(bg=Styles.colours["grey"])

        headersmall(curresultsframe, "Latest Iteration: ").grid(row=0, column=0, sticky=W + E + N + S)

        Label(curresultsframe, text="y:", font=Styles.fonts["entry"], bg=Styles.colours["grey"], width=9).grid(row=0,
                                                                                                               column=1,
                                                                                                               sticky=E)
        self.cury = Label(curresultsframe, text="-", width=20, font=Styles.fonts["h2"], bg=Styles.colours["grey"])
        self.cury.grid(row=0, column=2, sticky=W)

        Label(curresultsframe, text="mu:", font=Styles.fonts["entry"], bg=Styles.colours["grey"], width=9).grid(row=1,
                                                                                                                column=1,
                                                                                                                sticky=E)
        self.curmu = Label(curresultsframe, text=self.iniparams["totbest"], bg=Styles.colours["grey"], width=20,
                           font=Styles.fonts["h2"])
        self.curmu.grid(row=1, column=2, sticky=W)

        Label(curresultsframe, text="var:", font=Styles.fonts["entry"], bg=Styles.colours["grey"], width=9).grid(row=2,
                                                                                                                 column=1,
                                                                                                                 sticky=E)
        self.curvar = Label(curresultsframe, text=self.iniparams["totbest"], bg=Styles.colours["grey"], width=20,
                            font=Styles.fonts["h2"])
        self.curvar.grid(row=2, column=2, sticky=W)

        modeldetails.grid(row=0, column=0, columnspan=3, sticky=W + E + N + S)

        fm.grid(row=1, column=0, columnspan=3, sticky=W + E + N + S, padx=20)

        self.numexperitments.grid(row=4, column=0, columnspan=3, sticky=W + E + N + S)

        resultsframe.grid(row=7, column=0, columnspan=3, sticky=W + E + N + S)
        curresultsframe.grid(row=8, column=0, columnspan=3, sticky=W + E + N + S)
        f.grid(row=0, column=1, sticky=W + E + N + S)
예제 #2
0
파일: evaluate.py 프로젝트: jakedm/projectb
    def evaluationUI(self):
        modeldetails = header(self.frame,"Model")
        fm = Frame(self.frame)
        fm.config(bg=Styles.colours["grey"])
        resultdetails = header(self.frame,"Results")
        resultsframe = Frame(self.frame)
        resultsframe.config(bg=Styles.colours["grey"])


        #Model details
        Message(fm, text="Command:", font=Styles.fonts["h2"], bg=Styles.colours["grey"],width=200).grid(row=0,column=0,sticky=E)
        Message(fm, text=self.params["command"].get(), font=Styles.fonts["h3"], bg=Styles.colours["grey"],width=415).grid(row=0,column=1,sticky=W)
        Message(fm, text="Model Input:", font=Styles.fonts["h2"], bg=Styles.colours["grey"],width=200).grid(row=1,column=0,sticky=E)
        Message(fm, text=self.params["modelinput"].get(), font=Styles.fonts["h3"], bg=Styles.colours["grey"],width=415).grid(row=1,column=1,sticky=W)
        Message(fm, text="Model Output:", font=Styles.fonts["h2"], bg=Styles.colours["grey"],width=200).grid(row=2,column=0,sticky=E)
        Message(fm, text=self.params["modeloutput"].get(), font=Styles.fonts["h3"], bg=Styles.colours["grey"],width=415).grid(row=2,column=1,sticky=W)

        #Table Headers
        Label(resultsframe,text=" # ", font=Styles.fonts["entry"],bg=Styles.colours["grey"],width=5).grid(row=0,column=0,sticky=E)
        Label(resultsframe,text="Kernel:", font=Styles.fonts["entry"],bg=Styles.colours["grey"],width=9).grid(row=0,column=1,sticky=E)
        Label(resultsframe,text="Policy:", font=Styles.fonts["entry"],bg=Styles.colours["grey"],width=9).grid(row=0,column=2,sticky=E)
        Label(resultsframe,text="Iterations:", font=Styles.fonts["entry"],bg=Styles.colours["grey"],width=14).grid(row=0,column=3,sticky=E)
        Label(resultsframe,text="Best Result:", font=Styles.fonts["entry"],bg=Styles.colours["grey"],width=14).grid(row=0,column=4,sticky=E)
        Label(resultsframe,text="Time (s):", font=Styles.fonts["entry"],bg=Styles.colours["grey"],width=14).grid(row=0,column=5,sticky=E)
        Label(resultsframe,text="", font=Styles.fonts["entry"],bg=Styles.colours["grey"],width=14).grid(row=0,column=6,sticky=E)

        #Table Data
        for i,e in enumerate(self.experiments):
            if e.has_key("iterfinish"):
                Label(resultsframe,text=str(i+1), font=Styles.fonts["entryFilled"],bg=Styles.colours["grey"],width=5).grid(row=i+1,column=0,sticky=E)
                Label(resultsframe,text=e["kernel"].upper(), font=Styles.fonts["entryFilled"],bg=Styles.colours["grey"],width=9).grid(row=i+1,column=1,sticky=E)
                Label(resultsframe,text=e["policy"][0].upper(), font=Styles.fonts["entryFilled"],bg=Styles.colours["grey"],width=9).grid(row=i+1,column=2,sticky=E)
                Label(resultsframe,text=e["iterfinish"], font=Styles.fonts["entryFilled"],bg=Styles.colours["grey"],width=14).grid(row=i+1,column=3,sticky=E)
                Label(resultsframe,text="{0:.5f}".format(e["best"]), font=Styles.fonts["entryFilled"],bg=Styles.colours["grey"],width=14).grid(row=i+1,column=4,sticky=E)
                Label(resultsframe,text="{0:.2f}".format(e["time"]), font=Styles.fonts["entryFilled"],bg=Styles.colours["grey"],width=14).grid(row=i+1,column=5,sticky=E)
                yellowbutton(resultsframe,"Query",10,lambda x: self.query(e["modelid"])).grid(row=i+1,column=6,sticky=E,pady=3)
            else:
                Label(resultsframe,text=str(i+1), font=Styles.fonts["entry"],bg=Styles.colours["grey"],width=5).grid(row=i+1,column=0,sticky=E)
                Label(resultsframe,text=e["kernel"].upper(), font=Styles.fonts["entry"],bg=Styles.colours["grey"],width=9).grid(row=i+1,column=1,sticky=E)
                Label(resultsframe,text=e["policy"][0].upper(), font=Styles.fonts["entry"],bg=Styles.colours["grey"],width=9).grid(row=i+1,column=2,sticky=E)
                Label(resultsframe,text="Not Started", font=Styles.fonts["entry"],bg=Styles.colours["grey"],width=14).grid(row=i+1,column=3,sticky=W+E,columnspan=3)

        #Footer buttons
        y1 = camobutton(self.footer,"Save Console Logs",18,click=lambda x: self.saveconsole())
        y1.config(font=Styles.fonts["h2"])
        y1.pack(side=LEFT,fill=BOTH, padx=5, pady=5)

        y2 = camobutton(self.footer,"Output Directory",18,lambda x: self.opendir())
        y2.config(font=Styles.fonts["h2"])
        y2.pack(side=LEFT,fill=BOTH, padx=5, pady=5)

        y3 = yellowbutton(self.footer,"Exit",18,lambda x: self.closeall())
        y3.config(font=Styles.fonts["h2"])
        y3.pack(side=RIGHT,fill=BOTH, padx=5, pady=5)


        #Grid everything
        #Model Title and Frame
        modeldetails.grid(row=0,column=0,columnspan=3,sticky=W + E + N + S)
        fm.grid(row=1, column=0,columnspan=3,sticky=W + E + N + S)
        #Result Title and Frame
        resultdetails.grid(row=2, column=0,columnspan=3,sticky=W + E + N + S)
        resultsframe.grid(row=3, column=0,columnspan=3,sticky=W + E + N + S)
        #Footer
        self.footer.grid(row=3,column=0,sticky=W+E+N+S,columnspan=2)