Skip to content

Error when order_indep=True #10

@LiujunWang

Description

@LiujunWang

if order_indep=True, gen_coaction function will run error as weight (line 27) will contain matrix weights of other order.

It can be corrected by:

def gen_coaction(ad, his_items, dim, mode="can", mask=None):
    idx = 0
    weight_orders = []
    bias_orders = []
    for i in range(orders):
        weight, bias = [], []
        for w, b in zip(weight_emb_w, weight_emb_b):
            weight.append(tf.reshape(ad[:, idx:idx+w[0]*w[1]], [-1, w[0], w[1]]))
            idx += w[0] * w[1]
            if b == 0:
                bias.append(None)
            else:
                bias.append(tf.reshape(ad[:, idx:idx+b], [-1, 1, b]))
                idx += b
        weight_orders.append(weight)
        bias_orders.append(bias)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions