GriffinLiang / vrd-dsr

Code for Visual Relationship Detection with Deep Structural Ranking (AAAI2018)
121 stars 32 forks source link

Question about so_prior.pkl #9

Closed xuewenyuan closed 5 years ago

xuewenyuan commented 6 years ago
  1. When I use word2vec to map the obeject category into a feature embedding vector, how should I prepare the sentences used for word2vec model ? (like 'person near building'?)

  2. The tensor of _soprior.pkl has a shape of (100, 100, 70), which represents 100 obeject categories and 70 predicates. Once I have a word2vec model that can map a obeject category into a feature embedding vector, how can I create _soprior.pkl? Specifically, how can I concatenate the embedding vectors of subject and object for a special predicate?

Thank you!

GriffinLiang commented 6 years ago
  1. This project only uses the off-the-shelf word2vec model.
  2. so_prior.pkl is calculated from the training data. For concatenation of subject and object, please refer to https://github.com/GriffinLiang/vrd-dsr/blob/master/lib/nets/Vrd_Model.py L127-L134.
xuewenyuan commented 6 years ago

@GriffinLiang thank you for your reply! But I'm still confused about how to calculate _soprior.pkl on my dataset. If I understand correctly, _soprior.pkl stores the items that is mentioned in your paper. Could you please share with me more?

GriffinLiang commented 6 years ago

so_prior.pkl contains the conditional probability given subject and object. For example, if we want to calculate p(ride|person, horse), we should find all the relationships describing person and horse and the exact relationships of person-ride-horse. We use N and M to denote the number of the above two relationships, and p(ride|person, horse) can be simply acquired as N/M.

xuewenyuan commented 6 years ago

Thanks a lot! I think I have a better understanding.

sukrutrao commented 6 years ago

@GriffinLiang Is so_prior.pkl stored in (subject, object, predicate) format? As the shape is (100,100,70), I wanted to clarify against the other possibility - (object, subject, predicate). Thank you.

GriffinLiang commented 6 years ago

You are right, The order is (subject, object, predicate) .

2018-05-31 15:02 GMT+08:00 Sukrut Rao notifications@github.com:

@GriffinLiang https://github.com/GriffinLiang Is so_prior.pkl stored in (subject, object, predicate) format? As the shape is (100,100,70), I wanted to clarify against the other possibility - (object, subject, predicate). Thank you.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GriffinLiang/vrd-dsr/issues/9#issuecomment-393429402, or mute the thread https://github.com/notifications/unsubscribe-auth/AGupmlGL4Qx8TlfENq3Q2C7wRydmNknTks5t35WGgaJpZM4T1Hjd .

sukrutrao commented 6 years ago

Thank you for the clarification.

lileilai commented 5 years ago

@xuewenyuan 请问你有成功复现这篇文章吗?有一些问题想请教您,期望您能解答一下,谢谢。

xuewenyuan commented 5 years ago

@lileilai yeah, what's your question?

waallf commented 5 years ago

@lileilai yeah, what's your question?

你好,可以解释一下损失函数吗?按照论文里的公式,没有理解代码.

xuewenyuan commented 5 years ago

@lileilai yeah, what's your question?

你好,可以解释一下损失函数吗?按照论文里的公式,没有理解代码.

Sorry for replying you so late. Recently, I wrote a note for this paper. If you still have questions after reading, please send me an email.

lileilai commented 5 years ago

不好意思 没有再follow这篇文章了,

关于损失函数可以看它的代码实现,由于分类类别太多,所以主要是基于hinge loss的这种形式

目的是让正例(标注的关系)的得分更好,负例(负采样的关系)变差。其中的阀值 作者设计中加入了先验知识条件概率

我大概也就知道这么多 希望能帮到你

------------------ Original ------------------ From: "Wenyuan"notifications@github.com; Date: Thu, Dec 27, 2018 11:04 PM To: "GriffinLiang/vrd-dsr"vrd-dsr@noreply.github.com; Cc: "leilai li"lillai@mail2.sysu.edu.cn; "Mention"mention@noreply.github.com; Subject: Re: [GriffinLiang/vrd-dsr] Question about so_prior.pkl (#9)

@lileilai yeah, what's your question?

你好,可以解释一下损失函数吗?按照论文里的公式,没有理解代码.

Sorry for replying you so late. Recently, I wrote a note for this paper. If you still have questions after reading, please send me an email.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.