Example #1
0
    def __init__(self, experiment):
        """
    Adds the ResultsInspector and a magnifying glass button to the base class.

    experiment -- the running experiment.
    """
        PredictionGUI.__init__(self,
                               experiment=experiment,
                               addInspectorButton=False)

        # Set the RuntimeInspector title
        self.title.SetLabel('Running inference')

        # Add a vertical line in between the inspectors
        self.hSizer.Add(wx.StaticLine(self.panel, style=wx.LI_VERTICAL),
                        flag=wx.EXPAND | wx.LEFT | wx.RIGHT,
                        border=2)

        # Add the ResultsInspector and its title
        resultsSizer = wx.BoxSizer(wx.VERTICAL)
        title = wx.StaticText(self.panel, label='Inference results')
        title.SetFont(self.titleFont)
        self.resultsInspector = ResultsInspector(parent=self.panel,
                                                 network=experiment.network,
                                                 numTopResults=3)
        # Add the title and the inspector button in a horizontal sizer
        titleSizer = wx.BoxSizer(wx.HORIZONTAL)
        titleSizer.Add(title, flag=wx.ALL, border=3)
        titleSizer.AddStretchSpacer()
        titleSizer.Add(self.inspectorBitmap)
        # Add to a vertical sizer
        resultsSizer.Add(titleSizer,
                         flag=wx.EXPAND | wx.RIGHT | wx.BOTTOM,
                         border=2)
        resultsSizer.AddStretchSpacer()
        resultsSizer.Add(
            self.resultsInspector.edit_traits(parent=self.panel,
                                              kind='panel').control)
        resultsSizer.AddStretchSpacer()
        # Add the vertical sizer to the horizontal sizer
        self.hSizer.Add(resultsSizer, flag=wx.ALL | wx.EXPAND, border=3)

        # Append the results inspector to the list of inspectors
        self.inspectors.append(self.resultsInspector)

        # Set the window title
        self.SetTitle("Running inference")
Example #2
0
class InferenceGUI(PredictionGUI):
    def __init__(self, experiment):
        """
    Adds the ResultsInspector and a magnifying glass button to the base class.

    experiment -- the running experiment.
    """
        PredictionGUI.__init__(self,
                               experiment=experiment,
                               addInspectorButton=False)

        # Set the RuntimeInspector title
        self.title.SetLabel('Running inference')

        # Add a vertical line in between the inspectors
        self.hSizer.Add(wx.StaticLine(self.panel, style=wx.LI_VERTICAL),
                        flag=wx.EXPAND | wx.LEFT | wx.RIGHT,
                        border=2)

        # Add the ResultsInspector and its title
        resultsSizer = wx.BoxSizer(wx.VERTICAL)
        title = wx.StaticText(self.panel, label='Inference results')
        title.SetFont(self.titleFont)
        self.resultsInspector = ResultsInspector(parent=self.panel,
                                                 network=experiment.network,
                                                 numTopResults=3)
        # Add the title and the inspector button in a horizontal sizer
        titleSizer = wx.BoxSizer(wx.HORIZONTAL)
        titleSizer.Add(title, flag=wx.ALL, border=3)
        titleSizer.AddStretchSpacer()
        titleSizer.Add(self.inspectorBitmap)
        # Add to a vertical sizer
        resultsSizer.Add(titleSizer,
                         flag=wx.EXPAND | wx.RIGHT | wx.BOTTOM,
                         border=2)
        resultsSizer.AddStretchSpacer()
        resultsSizer.Add(
            self.resultsInspector.edit_traits(parent=self.panel,
                                              kind='panel').control)
        resultsSizer.AddStretchSpacer()
        # Add the vertical sizer to the horizontal sizer
        self.hSizer.Add(resultsSizer, flag=wx.ALL | wx.EXPAND, border=3)

        # Append the results inspector to the list of inspectors
        self.inspectors.append(self.resultsInspector)

        # Set the window title
        self.SetTitle("Running inference")

    def start(self):
        """Called for each tier. Sets the title and then calls the base class."""

        #from dbgp.client import brk; brk(port=9011)
        self.title.SetLabel('infer')
        phase = self.experiment.description['infer']
        iterationCount = phase[0].get('iterationCount',
                                      None) if len(phase) > 0 else None
        PredictionGUI.start(self, iterationCount, self.tier)
Example #3
0
File: GUIs.py Project: 0x0all/nupic
class InferenceGUI(PredictionGUI):

  def __init__(self, experiment):
    """
    Adds the ResultsInspector and a magnifying glass button to the base class.

    experiment -- the running experiment.
    """
    PredictionGUI.__init__(self, experiment=experiment, addInspectorButton=False)

    # Set the RuntimeInspector title
    self.title.SetLabel('Running inference')

    # Add a vertical line in between the inspectors
    self.hSizer.Add(wx.StaticLine(self.panel, style=wx.LI_VERTICAL),
                    flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=2)

    # Add the ResultsInspector and its title
    resultsSizer = wx.BoxSizer(wx.VERTICAL)
    title = wx.StaticText(self.panel, label='Inference results')
    title.SetFont(self.titleFont)
    self.resultsInspector = ResultsInspector(parent=self.panel,
                              network=experiment.network, numTopResults=3)
    # Add the title and the inspector button in a horizontal sizer
    titleSizer = wx.BoxSizer(wx.HORIZONTAL)
    titleSizer.Add(title, flag=wx.ALL, border=3)
    titleSizer.AddStretchSpacer()
    titleSizer.Add(self.inspectorBitmap)
    # Add to a vertical sizer
    resultsSizer.Add(titleSizer, flag=wx.EXPAND|wx.RIGHT|wx.BOTTOM, border=2)
    resultsSizer.AddStretchSpacer()
    resultsSizer.Add(self.resultsInspector.edit_traits(parent=self.panel,
                                                       kind='panel').control)
    resultsSizer.AddStretchSpacer()
    # Add the vertical sizer to the horizontal sizer
    self.hSizer.Add(resultsSizer, flag=wx.ALL|wx.EXPAND, border=3)

    # Append the results inspector to the list of inspectors
    self.inspectors.append(self.resultsInspector)

    # Set the window title
    self.SetTitle("Running inference")

  def start(self):
    """Called for each tier. Sets the title and then calls the base class."""

    #from dbgp.client import brk; brk(port=9011)
    self.title.SetLabel('infer')
    phase = self.experiment.description['infer']
    iterationCount = phase[0].get('iterationCount', None) if len(phase) > 0 else None
    PredictionGUI.start(self, iterationCount, self.tier)
Example #4
0
File: GUIs.py Project: 0x0all/nupic
  def __init__(self, experiment):
    """
    Adds the ResultsInspector and a magnifying glass button to the base class.

    experiment -- the running experiment.
    """
    PredictionGUI.__init__(self, experiment=experiment, addInspectorButton=False)

    # Set the RuntimeInspector title
    self.title.SetLabel('Running inference')

    # Add a vertical line in between the inspectors
    self.hSizer.Add(wx.StaticLine(self.panel, style=wx.LI_VERTICAL),
                    flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=2)

    # Add the ResultsInspector and its title
    resultsSizer = wx.BoxSizer(wx.VERTICAL)
    title = wx.StaticText(self.panel, label='Inference results')
    title.SetFont(self.titleFont)
    self.resultsInspector = ResultsInspector(parent=self.panel,
                              network=experiment.network, numTopResults=3)
    # Add the title and the inspector button in a horizontal sizer
    titleSizer = wx.BoxSizer(wx.HORIZONTAL)
    titleSizer.Add(title, flag=wx.ALL, border=3)
    titleSizer.AddStretchSpacer()
    titleSizer.Add(self.inspectorBitmap)
    # Add to a vertical sizer
    resultsSizer.Add(titleSizer, flag=wx.EXPAND|wx.RIGHT|wx.BOTTOM, border=2)
    resultsSizer.AddStretchSpacer()
    resultsSizer.Add(self.resultsInspector.edit_traits(parent=self.panel,
                                                       kind='panel').control)
    resultsSizer.AddStretchSpacer()
    # Add the vertical sizer to the horizontal sizer
    self.hSizer.Add(resultsSizer, flag=wx.ALL|wx.EXPAND, border=3)

    # Append the results inspector to the list of inspectors
    self.inspectors.append(self.resultsInspector)

    # Set the window title
    self.SetTitle("Running inference")