Exemplo n.º 1
0
def do_PN(tuplelist, mydict, term, pn_num, pn_total_num):
    # pn = p(y'_x'|x,y)
    if(mydict[term] == True and get_value(tuplelist, mydict, term)==True) :
        pn_total_num += 1 ;
        mydict[term] = False ;
        pn_flag = get_value(tuplelist, mydict, term) ;
        if( pn_flag == False ):
            pn_num = pn_num + 1 ;
        
    return [pn_num, pn_total_num] ;
Exemplo n.º 2
0
def do_PS(tuplelist, mydict, term, ps_num, ps_total_num):
    # ps = p(Y_x|x',y') ;
    if(mydict[term] == False and get_value(tuplelist, mydict, term)==False) : 
        # -------- set edge true ---------
        ps_total_num += 1 ;
        mydict[term] = True ;
        ps_flag = get_value(tuplelist, mydict, term) ; 
        if( ps_flag == True ):
            ps_num = ps_num + 1 ;

    return [ps_num, ps_total_num] ;
Exemplo n.º 3
0
def do_PN(tuplelist, mydict, term, pn_num, pn_total_num):
    # pn = p(y'_x'|x,y)
    if(mydict[term] == True and get_value(tuplelist, mydict, term)==True) :
        pn_total_num += 1 ;
        mydict[term] = False ;
        active_nums = get_active_targets(mydict) ;
        if( active_nums < at_least_k ):
            pn_num = pn_num + 1 ;
        
    return [pn_num, pn_total_num] ;
Exemplo n.º 4
0
def do_PS(tuplelist, mydict, term, ps_num, ps_total_num):
    # ps = p(Y_x|x',y') ;
    if(mydict[term] == False and get_value(tuplelist, mydict, term)==False) : 
        # -------- set edge true ---------
        ps_total_num += 1 ;
        mydict[term] = True ;
        active_nums = get_active_targets(mydict) ; 
        if( active_nums > at_least_k ):
            ps_num = ps_num + 1 ;

    return [ps_num, ps_total_num] ;