Skip to content

ValueError when running python swmd.py #1

@yiwenlaw

Description

@yiwenlaw

Hi Boyuan,

I'm quite a lot impressed by your Python codebase of S-WMD [Supervised Word Mover's Distance, NIPS 2016]. However when I was following your instruction and trying to run "python swmd.py", I got into this error:

$ python swmd.py
Dataset: bbcsport split: 1 Iteration: 1
Traceback (most recent call last):
  File "swmd.py", line 108, in <module>
    [dw, dA] = f.grad_swmd(xtr,ytr,BOW_xtr,indices_tr,xtr_center,w,A,lambdA,batch,rangE)
  File "functions.pyx", line 235, in functions.grad_swmd
    dw_ii[idx_i] = dw_ii[idx_i] + cij*dwmd_dwi
ValueError: shape mismatch: value array of shape (77,77) could not be broadcast to indexing result of shape (77,)

So I wonder am I missing something? Thanks a lot in advance. :)

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