Comments (4)
Hi, thanks for your interests in this work and sorry for the late reply. They are one-hot embeddings.
from vqa_regat.
Dear scholar,
Did your code pos_embedding.py show the same type id num like the below picture?
from vqa_regat.
Dear scholar, This is your code in pos_emb.py
y_diff = center_y[i] - center_y[j] x_diff = center_x[i] - center_x[j] diag = math.sqrt((y_diff)**2 + (x_diff)**2) if diag < 0.5 * image_diag: sin_ij = y_diff/diag cos_ij = x_diff/diag if sin_ij >= 0 and cos_ij >= 0: label_i = np.arcsin(sin_ij) label_j = 2*math.pi - label_i elif sin_ij < 0 and cos_ij >= 0: label_i = np.arcsin(sin_ij)+2*math.pi label_j = label_i - math.pi elif sin_ij >= 0 and cos_ij < 0: label_i = np.arccos(cos_ij) label_j = 2*math.pi - label_i else: label_i = -np.arccos(sin_ij)+2*math.pi label_j = label_i - math.pi adj_matrix[i, j] = int(np.ceil(label_i/(math.pi/4)))+3 adj_matrix[j, i] = int(np.ceil(label_j/(math.pi/4)))+3
But I think if obey the below picture type id num , maybe the following
if sin_ij >= 0 and cos_ij >= 0:# j is in the second Quadrant, i is the reference center label_i = math.pi - np.arcsin(sin_ij) label_j = 2*math.pi - np.arcsin(sin_ij) print(math.degrees(label_i)) print(math.degrees(label_j)) elif sin_ij < 0 and cos_ij >= 0:#j is in the third Quadrant, i is the reference center label_i = -np.arcsin(sin_ij)+math.pi label_j = np.arccos(cos_ij) print(math.degrees(label_i)) print(math.degrees(label_j)) elif sin_ij >= 0 and cos_ij < 0: #j is in the first Quadrant, i is the reference center label_i = np.arcsin(sin_ij) label_j = math.pi + np.arcsin(sin_ij) print(math.degrees(label_i)) print(math.degrees(label_j)) else:# j is in the fourth Quadrant, i is the reference center label_i = np.arcsin(sin_ij)+2*math.pi label_j = math.pi + np.arcsin(sin_ij) print(math.degrees(label_i)) print(math.degrees(label_j)) adj_matrix[i, j] = int(np.ceil(label_i/(math.pi/4)))+3 adj_matrix[j, i] = int(np.ceil(label_j/(math.pi/4)))+3
For spatial relations, as we do not use their semantic meaning during graph attention. The order of the labels do not matter. But you are right, the labels are not exactly the same as the ones in the pictures.
from vqa_regat.
0: wearing,
1: holding,
2: sitting on,
3: standing on,
4: riding,
5:eating,
6:hanging from,
7:carrying,
8:attached to, 9: walking on,
10: playing,
11:covering,
12: lying on, 13:watching,
14:looking at
the relation is 4: riding, 10: playing I think it must be my error but I don't know where the error is .
Remember that our semantic relation labels are predictions from a neural network, so the labels are not ground truth labels, which means there are very likely mistakes made in predictions. Also, can you remind me where did you get the label to relation mapping? It has been a while since I worked on this project, just want to make sure that we are on the same page.
from vqa_regat.
Related Issues (20)
- Training confusion HOT 1
- Some questions about the union bounding box feature vector for classifer mode HOT 1
- Load the cake/val_target. pkl HOT 1
- Some question about semantic relationship classification HOT 1
- Does the setting of num_workers in DataLoder affect the final result? HOT 1
- Learning rate related issues HOT 1
- Wdir(i,j) in Function 8 in the explicit model HOT 6
- Questions for categories HOT 2
- pos_box/bb HOT 2
- about weighted sum of the three modules
- NOthing HOT 2
- features/model that are interrupted during download doesn't continue from the last checkpoint HOT 5
- weighted sum confusion HOT 2
- Can you tell me the specific label of the semantic relationship type?
- How to test your model with image and text input by a user? HOT 2
- Loss can't backward HOT 2
- attention map
- unhandled cuda error HOT 1
- Can you provide a well-trained model? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vqa_regat.