(self, batch)
return cond
Generate the conditional vector for generation use original frequency.
Generate the conditional vector for generation use original frequency.
Generate the conditional vector for generation use original frequency .
def sample_original_condvec(self, batch):
        """Generate the conditional vector for generation use original frequency."""
        if self._n_discrete_columns == 0:
            return None

        cond = np.zeros((batch, self._n_categories), dtype='float32')

        for i in range(batch):
            row_idx = np.random.randint(0, len(self._data))
            col_idx = np.random.randint(0, self._n_discrete_columns)
            matrix_st = self._discrete_column_matrix_st[col_idx]
            matrix_ed = matrix_st + self._discrete_column_n_category[col_idx]
            pick = np.argmax(self._data[row_idx, matrix_st:matrix_ed])
            cond[i, pick + self._discrete_column_cond_st[col_idx]] = 1

        return cond
def sample_original_condvec ( self , batch ) : if self . _n_discrete_columns == 0 : return None cond = np . zeros ( ( batch , self . _n_categories ) , dtype = 'float32' ) for i in range ( batch ) : row_idx = np . random . randint ( 0 , len ( self . _data ) ) col_idx = np . random . randint ( 0 , self . _n_discrete_columns ) matrix_st = self . _discrete_column_matrix_st [ col_idx ] matrix_ed = matrix_st + self . _discrete_column_n_category [ col_idx ] pick = np . argmax ( self . _data [ row_idx , matrix_st : matrix_ed ] ) cond [ i , pick + self . _discrete_column_cond_st [ col_idx ] ] = 1 return cond