(self)
return labels, is_clean
generate_weak_labels returns a tensor where for each VID we have the
        domain index of the initial value.

        :return: Torch.Tensor of size (# of variables) X 1 where tensor[i][0]
            contains the domain index of the initial value for the i-th
            variable/VID.
generate_weak_labels returns a tensor where for each VID we have the
        domain index of the initial value.
generate_weak_labels returns a tensor where for each VID we have the domain index of the initial value .
def generate_weak_labels(self):
        """
        generate_weak_labels returns a tensor where for each VID we have the
        domain index of the initial value.

        :return: Torch.Tensor of size (# of variables) X 1 where tensor[i][0]
            contains the domain index of the initial value for the i-th
            variable/VID.
        """
        # Generate weak labels for clean cells AND cells that have been weak
        # labelled. Do not train on cells with NULL weak labels (i.e.
        # NULL init values that were not weak labelled).
        query = """
        SELECT _vid_, weak_label_idx, fixed, (t2._cid_ IS NULL) AS clean
        FROM {cell_domain} AS t1 LEFT JOIN {dk_cells} AS t2 ON t1._cid_ = t2._cid_
        WHERE weak_label != '{null_repr}' AND (t2._cid_ is NULL OR t1.fixed != {cell_status});
        """.format(cell_domain=AuxTables.cell_domain.name,
                dk_cells=AuxTables.dk_cells.name,
                null_repr=NULL_REPR,
                cell_status=CellStatus.NOT_SET.value)
        res = self.ds.engine.execute_query(query)
        if len(res) == 0:
            raise Exception("No weak labels available. Reduce pruning threshold.")
        labels = -1 * torch.ones(self.total_vars, 1).type(torch.LongTensor)
        is_clean = torch.zeros(self.total_vars, 1).type(torch.LongTensor)
        for tuple in tqdm(res):
            vid = int(tuple[0])
            label = int(tuple[1])
            fixed = int(tuple[2])
            clean = int(tuple[3])
            labels[vid] = label
            is_clean[vid] = clean
        return labels, is_clean
def generate_weak_labels ( self ) : # Generate weak labels for clean cells AND cells that have been weak # labelled. Do not train on cells with NULL weak labels (i.e. # NULL init values that were not weak labelled). query = """
        SELECT _vid_, weak_label_idx, fixed, (t2._cid_ IS NULL) AS clean
        FROM {cell_domain} AS t1 LEFT JOIN {dk_cells} AS t2 ON t1._cid_ = t2._cid_
        WHERE weak_label != '{null_repr}' AND (t2._cid_ is NULL OR t1.fixed != {cell_status});
        """ . format ( cell_domain = AuxTables . cell_domain . name , dk_cells = AuxTables . dk_cells . name , null_repr = NULL_REPR , cell_status = CellStatus . NOT_SET . value ) res = self . ds . engine . execute_query ( query ) if len ( res ) == 0 : raise Exception ( "No weak labels available. Reduce pruning threshold." ) labels = - 1 * torch . ones ( self . total_vars , 1 ) . type ( torch . LongTensor ) is_clean = torch . zeros ( self . total_vars , 1 ) . type ( torch . LongTensor ) for tuple in tqdm ( res ) : vid = int ( tuple [ 0 ] ) label = int ( tuple [ 1 ] ) fixed = int ( tuple [ 2 ] ) clean = int ( tuple [ 3 ] ) labels [ vid ] = label is_clean [ vid ] = clean return labels , is_clean