ethanfetaya / NRI

Neural relational inference for interacting systems - pytorch
MIT License
739 stars 157 forks source link

Is it possible to learn more than 2 edge-types in unsupervised manner? #26

Open dlehgo14 opened 4 years ago

dlehgo14 commented 4 years ago

Hello, thank you for your great work and nice code.

I saw the supplementary material, and it said that NRI can learn "known" 3 edge types (no-interaction, weak spring, strong spring). In this sentence, dose "known" mean that NRI can learn the relations only in supervised manner, not in unsupervised manner? In the source code, is it right that relation-supervised training is not implemented?

Again, thank you for your great work!

ethanfetaya commented 4 years ago

The number of edges is a parameter that can be set to any number of edge types (of course not all numbers might work well). When we said "known" we didn't mean supervised manner, but that the number of edge types is known in advance as it is a simulation created by us.

dlehgo14 commented 4 years ago

Thank you for the reply!

Now, I'm trying to reproduce the results, and generate a dataset of simulation that has 3 edge-types (weak spring, strong spring, no-interaction) The number of data is 50000, and training, testing sequence number is 49, validation sequence number is 99, and skip-first is True, (same as 2 edge-types dataset) and I changed "edge-types" variable to 3. When generating dataset, to create "edges" ground-truth, I set "no-relation" to 0, "weak spring" to 1, "strong spring" to 2.

When I trained NRI with 2 edge-types dataset (that I generate myself), It reaches to about 99% accuracy. However, it reached only 40% accuracy when the number of edge-types are 3 with the settings described above. I will try more, but could you give me some advice for better reproducing, if any?

fatcatZF commented 3 years ago

Thank you for your questions. I have not reproduced the results of this paper and I'm not very clear about the non-interaction edge type. Since there is no interaction between the non-interaction edge type should we directly ignore the non-interaction edge type in the decoder? E.g. If we use z{ij}=[0,1] to denote interaction and z{ij}=[1,0] to denote non-interaction, in the decoder should we write the edge embedding as: h^t{ij} = z{ij,0}fe([x^t_i, x^t_j]) ?

fatcatZF commented 3 years ago

Thank you for the reply!

Now, I'm trying to reproduce the results, and generate a dataset of simulation that has 3 edge-types (weak spring, strong spring, no-interaction) The number of data is 50000, and training, testing sequence number is 49, validation sequence number is 99, and skip-first is True, (same as 2 edge-types dataset) and I changed "edge-types" variable to 3. When generating dataset, to create "edges" ground-truth, I set "no-relation" to 0, "weak spring" to 1, "strong spring" to 2.

When I trained NRI with 2 edge-types dataset (that I generate myself), It reaches to about 99% accuracy. However, it reached only 40% accuracy when the number of edge-types are 3 with the settings described above. I will try more, but could you give me some advice for better reproducing, if any?

I think in the paper they mean there are still 2 edge types(interaction or non-interaction) in the labels, but add an 3rd unknown(non-exist) edge in the encoder.