Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when order_indep=True #10

Open
LiujunWang opened this issue Jul 6, 2023 · 0 comments
Open

Error when order_indep=True #10

LiujunWang opened this issue Jul 6, 2023 · 0 comments

Comments

@LiujunWang
Copy link

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant