Exemplo n.º 1
0
 def visualize(self, save_eps=True):
     """ 
     Show the internal state of the daisychain in a pictorial format 
     """
     tools.visualize_array(self.expected_cable_activities, 
                               label=self.name + '_exp_cable_act')
     #tools.visualize_array(self.post_uncertainty, 
     #                          label=self.name + '_post_uncert')
     tools.visualize_array(np.log(self.count + 1.), 
                               label=self.name + '_count')
Exemplo n.º 2
0
 def visualize(self, save_eps=True):
     """ Show the internal state of the daisychain in a pictorial format """
     tools.visualize_array(self.reward_value, label=self.name + '_reward')
     #tools.visualize_array(self.reward_uncertainty,
     #                          label=self.name + '_reward_uncertainty')
     tools.visualize_array(np.log(self.count + 1.),
                           label=self.name + '_count')
     #tools.visualize_daisychain(self, self.num_primitives,
     #                          self.num_actions, 10)
     return
Exemplo n.º 3
0
 def visualize(self, save_eps=False):
     print self.name, '0', np.nonzero(np.nan_to_num(np.copy(
             self.bundle_map)))[0]
     print self.name, '1', np.nonzero(np.nan_to_num(np.copy(
             self.bundle_map)))[1]
     print self.max_num_bundles, 'bundles maximum'
     tools.visualize_array(self.bundle_map, label=self.name + '_bundle_map')
     tools.visualize_array(self.agglomeration_energy, 
                           label=self.name + '_agg_energy')
     pass
Exemplo n.º 4
0
 def visualize(self, save_eps=True):
     """ Show the internal state of the daisychain in a pictorial format """
     tools.visualize_array(self.reward_value, 
                               label=self.name + '_reward')
     #tools.visualize_array(self.reward_uncertainty, 
     #                          label=self.name + '_reward_uncertainty')
     tools.visualize_array(np.log(self.count + 1.), 
                               label=self.name + '_count')
     #tools.visualize_daisychain(self, self.num_primitives, 
     #                          self.num_actions, 10)
     return
Exemplo n.º 5
0
 def visualize(self, save_eps=True):
     """ Show the internal state of the daisychain in a pictorial format """
     tools.visualize_array(self.expected_cable_activities,
                           label=self.name + '_exp_cable_act')
     tools.visualize_array(self.post_uncertainty,
                           label=self.name + '_post_uncert')
     tools.visualize_array(np.log(self.count + 1.),
                           label=self.name + '_count')
Exemplo n.º 6
0
    def visualize(self):
        """
        Turn the state of the ``ZipTie`` into an image.
        """
        print ' '.join(['ziptie', str(self.level)])
        # First list the bundles andthe cables in each.
        i_bundles = self.bundle_map_rows[:self.n_map_entries]
        i_cables = self.bundle_map_cols[:self.n_map_entries]
        i_bundles_unique = np.unique(i_bundles)
        if i_bundles_unique is not None:
            for i_bundle in i_bundles_unique:
                b_cables = list(
                    np.sort(i_cables[np.where(i_bundles == i_bundle)[0]]))
                print ' '.join(
                    ['    bundle',
                     str(i_bundle), 'cables:',
                     str(b_cables)])

        plot = False
        if plot:
            if self.n_map_entries > 0:
                # Render the bundle map.
                bundle_map = np.zeros(
                    (self.max_num_cables, self.max_num_bundles))
                nb.set_dense_val(bundle_map,
                                 self.bundle_map_rows[:self.n_map_entries],
                                 self.bundle_map_cols[:self.n_map_entries], 1.)
                tools.visualize_array(bundle_map,
                                      label=self.name + '_bundle_map')

                # Render the agglomeration energy.
                label = '_'.join([self.name, 'agg_energy'])
                tools.visualize_array(self.agglomeration_energy, label=label)
                plt.xlabel(str(np.max(self.agglomeration_energy)))

                # Render the nucleation energy.
                label = '_'.join([self.name, 'nuc_energy'])
                tools.visualize_array(self.nucleation_energy, label=label)
                plt.xlabel(str(np.max(self.nucleation_energy)))
Exemplo n.º 7
0
    def visualize(self):
        """
        Turn the state of the ``ZipTie`` into an image.
        """
        print ' '.join(['ziptie', str(self.level)])
        # First list the bundles andthe cables in each.
        i_bundles = self.bundle_map_rows[:self.n_map_entries]
        i_cables = self.bundle_map_cols[:self.n_map_entries]
        i_bundles_unique = np.unique(i_bundles)
        if i_bundles_unique is not None:
            for i_bundle in i_bundles_unique:
                b_cables = list(np.sort(i_cables[np.where(
                        i_bundles == i_bundle)[0]]))
                print ' '.join(['    bundle', str(i_bundle), 
                                'cables:', str(b_cables)])

        plot = False
        if plot: 
            if self.n_map_entries > 0:
                # Render the bundle map.
                bundle_map = np.zeros((self.max_num_cables, 
                                       self.max_num_bundles))
                nb.set_dense_val(bundle_map, 
                                 self.bundle_map_rows[:self.n_map_entries],
                                 self.bundle_map_cols[:self.n_map_entries], 1.)
                tools.visualize_array(bundle_map, 
                                      label=self.name + '_bundle_map')

                # Render the agglomeration energy.
                label = '_'.join([self.name, 'agg_energy'])
                tools.visualize_array(self.agglomeration_energy, label=label)
                plt.xlabel( str(np.max(self.agglomeration_energy)) )

                # Render the nucleation energy.
                label = '_'.join([self.name, 'nuc_energy'])
                tools.visualize_array(self.nucleation_energy, label=label)
                plt.xlabel( str(np.max(self.nucleation_energy)) )